Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/db/migrations/0066_add_iv.py   synnefo(Download)
from random import choice
from string import letters, digits
from synnefo.settings import SECRET_ENCRYPTION_KEY
 
DB_ENCRYPTED_FIELD_PREFIX = 'encrypted'
def encrypt(s, iv=None):
    if iv is None:
        obj = AES.new(_pad_secret(SECRET_ENCRYPTION_KEY), AES.MODE_CFB)
    else:
        obj = AES.new(_pad_secret(SECRET_ENCRYPTION_KEY), AES.MODE_CFB, iv)
def decrypt(s, iv=None):
    if iv is None:
        obj = AES.new(_pad_secret(SECRET_ENCRYPTION_KEY), AES.MODE_CFB)
    else:
        obj = AES.new(_pad_secret(SECRET_ENCRYPTION_KEY), AES.MODE_CFB, iv)

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/db/aes_encrypt.py   synnefo(Download)
from random import choice
from string import letters, digits
from synnefo.settings import SECRET_ENCRYPTION_KEY
 
 
def encrypt(s, iv):
    obj = AES.new(_pad_secret(SECRET_ENCRYPTION_KEY), AES.MODE_CFB, iv)
    return obj.encrypt(s)
 
 
def decrypt(s, iv):
    obj = AES.new(_pad_secret(SECRET_ENCRYPTION_KEY), AES.MODE_CFB, iv)