The Easiest Way to Encrypt in Python

Encrypting data is easy, but securing keys is very difficult. You can skim 6 Questions to Ask Before Encryption Data to get a better sense of the responsibilities that come with encrypting data.

Luckily, we can just use Peacemakr to solve these hard problems.

Peacemakr’s E2E-Encryption Python SDK

Peacemakr: The Easiest way to Encrypt in Python

#1 Install Dependencies

$ pip install peacemakr

#2 Get a Peacemakr APIKey


When you’re ready to use your own keys, just register for a free account at,

#3 Register your Client

import peacemakr as p
import peacemakr.factory as factory
api_key = "my-api-key-from-step-2-above"
persister = p.InMemoryPersister()
sdk = factory.get_crypto_sdk(api_key=api_key,
client_name="hello world",

#4 Finally, Encrypt your Data

import osrandom_bytes = os.urandom(100)
encrypted_bytes = sdk.encrypt(random_bytes)
...decrypted_bytes = sdk.decrypt(encrypted_bytes)

It’s really that simple. You can read up on what is happening under the hood directly in our open source SDKs, on our website.

15+ Years experience leading security, Ex-Apple, Ex-Pure Storage, Ex-Symphony Communications, Co-Founder and CEO of Peacemakr, Lives in San Francisco.