Ejemplo n.º 1
0
def aes_encrypt_str(s):
  """ AES encryption using the pycrpyto lib """
  from Crypto.Cipher import AES
  
  for i in range(16-(len(s) % 16)):
    s += " "
  
  enc_obj = AES.new(passphrase_dao.get_aes_encrypt_secret(), AES.MODE_ECB)
  return enc_obj.encrypt(s)
Ejemplo n.º 2
0
def aes_encrypt_str(s):
    """ AES encryption using the pycrpyto lib """
    from Crypto.Cipher import AES

    for i in range(16 - (len(s) % 16)):
        s += " "

    enc_obj = AES.new(passphrase_dao.get_aes_encrypt_secret(), AES.MODE_ECB)
    return enc_obj.encrypt(s)
Ejemplo n.º 3
0
def aes_decrypt_str(s):
  """ AES encryption using the pycrpyto lib """
  from Crypto.Cipher import AES
  enc_obj = AES.new(passphrase_dao.get_aes_encrypt_secret(), AES.MODE_ECB)
  return string.rstrip(enc_obj.decrypt(s))
Ejemplo n.º 4
0
def aes_decrypt_str(s):
    """ AES encryption using the pycrpyto lib """
    from Crypto.Cipher import AES
    enc_obj = AES.new(passphrase_dao.get_aes_encrypt_secret(), AES.MODE_ECB)
    return string.rstrip(enc_obj.decrypt(s))