@@ -0,0 +1,755 @@
+from django.conf import settings%0Afrom Crypto.Cipher import AES%0A%0Aimport base64%0A%0A%0Adef __pad(raw):%0A    if (len(raw) %25 16 == 0):%0A        return raw%0A    padding_required = 16 - (len(raw) %25 16)%0A    data = raw + '0' * padding_required%0A    return data%0A%0A%0Adef encode(raw):%0A    aes = AES.new(settings.AES_ENCRIPTION_KEY, AES.MODE_ECB)%0A    encoded = base64.b64encode(aes.encrypt(__pad(raw))).decode(%22utf-8%22)%0A    encoded = encoded.replace( %22+%22, %22%252B%22 );%0A    return encoded%0A%0A%0Adef decode(raw):%0A    aes = AES.new(settings.AES_ENCRIPTION_KEY, AES.MODE_ECB)%0A    missing_padding = len(raw) %25 4%0A    if missing_padding != 0:%0A        raw += b'0' * (4 - missing_padding)%0A    raw = aes.decrypt(base64.b64decode(str(raw))).decode('utf-8')%0A    raw = raw.rstrip(%220%22)%0A    return raw%0A

Add AES module