Exemplo n.º 1
0
 def test03(self):
     print '-------------------------'
     skey = 'Call me Ishmael.'[:16]
     nkey = str2nums(skey)
     plaintext = 'This is not a block length.'
     iv = [12, 34, 96, 15, 12, 34, 96, 15, 12, 34, 96, 15, 12, 34, 96, 15]
     pyen = aes.encryptDataIv(nkey, plaintext, iv)
     print pyen
     print ashex(pyen)
Exemplo n.º 2
0
 def test03(self):
   print '-------------------------'
   skey = 'Call me Ishmael.'[:16]
   nkey = str2nums(skey)
   plaintext = 'This is not a block length.'
   iv = [12, 34, 96, 15, 12, 34, 96, 15, 12, 34, 96, 15, 12, 34, 96, 15]
   pyen = aes.encryptDataIv(nkey, plaintext, iv)
   print pyen
   print ashex(pyen)
Exemplo n.º 3
0
    def testAesSha256en(self):
        print 'testAesSha256-------------------------'
        password = '******'
        sha = hashlib.sha256()
        sha.update(password)
        key = str2nums(sha.digest())

        md5 = hashlib.md5()
        md5.update(password)
        iv = str2nums(md5.digest())

        plaintext = "This is zhengrenqi's text."

        pyen = aes.encryptDataIv(key, plaintext, iv)
        print 'pyen:', type(pyen), pyen
        print ashex(pyen)
Exemplo n.º 4
0
  def testAesSha256en(self):
    print 'testAesSha256-------------------------'
    password = '******'
    sha = hashlib.sha256()
    sha.update(password)
    key = str2nums(sha.digest())

    md5 = hashlib.md5()
    md5.update(password)
    iv = str2nums(md5.digest())

    plaintext = "This is zhengrenqi's text."

    pyen = aes.encryptDataIv(key, plaintext, iv)
    print 'pyen:' , type(pyen), pyen
    print ashex(pyen)