首页新闻找找看学习计划

python aes加密问题

0
悬赏园豆:15 [待解决问题]
from Crypto.Cipher import AES
import base64
import os

    # the block size for the cipher object; must be 16, 24, or 32 for AES
BLOCK_SIZE = 16
secret = "1234567890123456" #os.urandom(BLOCK_SIZE)

# create a cipher object using the random secret
cipher = AES.new(secret)

myData='password12345678'
    #encoded = EncodeAES(cipher, myData)
encoded = cipher.encrypt(myData)
print 'Encrypted string:', base64.b64encode(encoded)
cipher=AES.new(secret)
decoded = cipher.decrypt(encoded)
print 'Decrypted string:', decoded

我想对这个 url 进行加密 http:\\127.0.0.1\ticket\service\check\?ticket_id=00001

会报错,要改哪里

Sunny.Day的主页 Sunny.Day | 初学一级 | 园豆:4
提问于:2015-03-19 12:42
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册