The Box class uses the given public and private (secret) keys to derive a shared key, which is used with the nonce given to encrypt the given messages and to decrypt the given ciphertexts. gnupg - a wrapper around the GnuPG executable. With this module Python programs can create and manage keys, encrypt and decrypt data, sign and verify documents. In asymmetric encryption you use a public key to encrypt, and only someone with the private key can decrypt it. I will also show you how to keep keys safe and how to use these methods on files. Implementing Cryptography in Python with FERNET. Encryption is a process that encodes a message or file so that it can be only be read by certain people. find e where e is coprime with phi(n) and N and 1