Skip to content

Instantly share code, notes, and snippets.

@kf0jvt
Created October 14, 2013 02:01
Show Gist options
  • Save kf0jvt/6969624 to your computer and use it in GitHub Desktop.
Save kf0jvt/6969624 to your computer and use it in GitHub Desktop.
Keyczar example
from keyczar import keyczar
s = 'secret string'
location = '/tmp/kz'
crypter = keyczar.Crypter.Read(location)
s_encrypted = crypter.Encrypt(s)
s_decrypted = crypter.Decrypt(s_encrypted)
print s
print s_encrypted
print s_decrypted
$ mkdir -p /tmp/kz
$ keyczart create --location=/tmp/kz --purpose=crypt
$ keyczart addkey --location=/tmp/kz --status=primary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment