aes

Is AES the same in libraries PyCrypto & Node.JS Crypto

回眸只為那壹抹淺笑 提交于 2020-01-01 06:29:18
问题 I am beginnging to wonder if the implementation of AES is different across libraries.. Currently i have a plaintext encrypted with PyCrypto. Im trying to decrypt the ciphertext with Node.js's Crypto Library.. Basically with PyCrypto.. im using AES-128-CBC with a random generated IV. (which decrypts perfectly in PyCrypto) However.. On Node.js im doing this var buf = new Buffer(ciphertext) var decipher = crypto.createDecipher('aes-128-cbc',aeskey) buf = decipher.update(buf,'binary', 'binary')

Speed difference between AES/CBC encryption and decryption?

本秂侑毒 提交于 2020-01-01 05:48:08
问题 I am wondering, theoretically, how much slower would AES/CBC decryption be compared to AES/CBC encryption with the following conditions: Encryption key of 32 bytes (256 bits); A blocksize of 16 bytes (128 bits). The reason that I ask is that I want to know if the decryption speed of an implementation that I have is not abnormally slow. I have done some tests on random memory blocks of different sizes. The results are as follows: 64B: 64KB: 10MB – 520MB: All data was stored on the internal

is AES key random?

放肆的年华 提交于 2020-01-01 03:32:05
问题 AES key may be generate by this code KeyGenerator kgen = KeyGenerator.getInstance("AES"); kgen.init(128); but If I have a "very reliable" method of generating random numbers can I use it in such a way SecureRandom rnd = new SecureRandom(); byte[] key = new byte[16]; rnd.nextBytes(key); is key obtained by this method reliable ? or it ONLY must generated by some SPECIAL algorithm 回答1: The AES key can be any 128 bits. It should be be practically unguessable, whatever the method of creating it.

AES-128 CBC decryption in Python

心不动则不痛 提交于 2020-01-01 03:27:26
问题 I'm trying to implement this code in python (I'm new to python) and it gives me the following error: AttributeError: 'str' object has no attribute 'decode' If we remove .decode ('hex') only to avoid such error: from itertools import product from Crypto.Cipher import AES import Crypto.Cipher.AES key = ('2b7e151628aed2a6abf7158809cf4f3c').decode('hex') IV = ('000102030405060708090a0b0c0d0e0f').decode('hex') plaintext1 = ('6bc1bee22e409f96e93d7e117393172a').decode('hex') plaintext2 = (

How to generate secret key in Java once and use that key in 2 different programs

。_饼干妹妹 提交于 2019-12-31 18:17:06
问题 My aim is to write a Java program to encrypt a text file ( cipher text ) using AES algorithm . And then, write another program to decrypt that encrypted file ( cipher text ) to get the plain text back. I want to use same key (same key, generate once, save it somewhere, and use it in both encryption and decryption program) for encryption and decryption process. If I generate key and do the encryption and decryption line by line in the same program then it works perfectly. Here is the working

AES256 CBC + HMAC SHA256 ensuring confidentiality *and* authentication?

限于喜欢 提交于 2019-12-31 08:49:11
问题 I'm thinking of using AES256 CBC + HMAC SHA-256 as a building block for messages that ensures both confidentiality and authentication. In particular, consider this scenario: Alice is possession a public key belonging to Bob (the key exchange and algorithm is outside the scope of this question). Alice has an identifying key K, also shared with Bob, that she can use to identify herself with. Only Alice and Bob knows the key K. Alice encrypts (nonce || K) using Bob's public key. Bob decrypts the

Different output encryption both CryptoJS and Java Code

て烟熏妆下的殇ゞ 提交于 2019-12-31 08:43:00
问题 I need to encrypt certainly string from client-side (JavaScript) and decrypt from server-side (Java), so I found CryptoJS and I write the code with the same params/configuration of mi Java Code but the output is always different, do you have any idea or what happen? I'm use CBC with NoPadding CryptoJS http://jsfiddle.net/Soldier/gCHAG/ <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"> </script> <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build

Different output encryption both CryptoJS and Java Code

自作多情 提交于 2019-12-31 08:42:06
问题 I need to encrypt certainly string from client-side (JavaScript) and decrypt from server-side (Java), so I found CryptoJS and I write the code with the same params/configuration of mi Java Code but the output is always different, do you have any idea or what happen? I'm use CBC with NoPadding CryptoJS http://jsfiddle.net/Soldier/gCHAG/ <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"> </script> <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build

C# PHP AES 256 CBC Encryption [closed]

余生长醉 提交于 2019-12-31 07:48:06
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . Hello I'm trying to encrypt files/strings on my server using PHP and AES 256 CBC mode, Because of strings ending with '\0' I can easly remove padding from them which AES adds, but with files I cannot because some of them contain null bytes. Before I send my data i encode it as base64 string. Here

Delphi AES library (Rijndael) tested with KAT Vectors

ぐ巨炮叔叔 提交于 2019-12-31 07:16:08
问题 for these 2 libraries, Delphi Encryption Compendium v 5.2 TurboPower Lockbox v 2.07 I tested their Rijndael DCB/CBC algorithm with "AES Known Answer Test (KAT) Vectors" obtained at NIST website (http://csrc.nist.gov/groups/STM/cavp/index.html) But, both of these libraries failed the tests. Not sure if it was my testing that has error, has anyone tested them before as well? I am looking for a Delphi Rijndael library that is able to pass the KAT Vectors test. Does anyone know of any such