Functional Encryption and its Applications to Decentralized Systems