python-simple-crypt

Need advice about AES CTR cipher python vs. Java

痴心易碎 提交于 2020-01-01 07:12:46
问题 I'm working on project when some arbitrary data are encrypted using Python simple-crypt (source here) and same encrypted data are then used in java application. I would like to understand conceptual difference between JSSE and Pycrypto. This is python part doing encryption (source): counter = Counter.new(HALF_BLOCK, prefix=salt[:HALF_BLOCK//8]) cipher = AES.new(cipher_key, AES.MODE_CTR, counter=counter) This is my attempt for java re-implementation of same operation: SecretKeySpec key = new

Need advice about AES CTR cipher python vs. Java

左心房为你撑大大i 提交于 2019-12-03 21:44:48
I'm working on project when some arbitrary data are encrypted using Python simple-crypt (source here ) and same encrypted data are then used in java application. I would like to understand conceptual difference between JSSE and Pycrypto. This is python part doing encryption ( source ): counter = Counter.new(HALF_BLOCK, prefix=salt[:HALF_BLOCK//8]) cipher = AES.new(cipher_key, AES.MODE_CTR, counter=counter) This is my attempt for java re-implementation of same operation: SecretKeySpec key = new SecretKeySpec(cipher_key, "AES"); IvParameterSpec ivSpec = new IvParameterSpec(salt, 0, HALF_BLOCK /