Comments (3)
During working on I noticed that my description is mostly wrong.
In fact using padding on decrypt isn't useless. And just using this option
doesn't reproduces the error at all.
I still trying to figure out what the actual problem is... just a bit
over-worked.
Original comment by [email protected]
on 27 May 2014 at 5:09
from crypto-js.
Ok, my big mistake was to pass an encoding object created by
CryptoJS.enc.Hex.parse() to decrypt method. But the method requires as
parameter an object with a "ciphertext" property:
CryptoJS.AES.decrypt({ ciphertext: encrypted_message }, key)
This is not well documented.
However I think there is a problem with the ZeroPadding option. If you pass
something without a "ciphertext" property to the decrypt function and specify
"padding: CryptoJS.pad.ZeroPadding" the script do endless processing. Use of
"NoPadding" or default padding just results in an empty decryption object.
Original comment by [email protected]
on 27 May 2014 at 9:43
from crypto-js.
I tried to mention this behavior in the Cipher Input section
(https://code.google.com/p/crypto-js/#The_Cipher_Input). "For the ciphertext,
the cipher algorithms accept either strings or instances of
CryptoJS.lib.CipherParams. A CipherParams object represents a collection of
parameters such as the IV, a salt, and the raw ciphertext itself."
I'd imagine that many parts, not just the padding, wouldn't work correctly if
it received the wrong kind of input, but that would have to fall under the
umbrella of "undefined behavior." Loosely typed languages such as JavaScript
will let you pass in any random thing, so unfortunately that leaves it entirely
up to you to make sure you pass in the right thing.
Original comment by Jeff.Mott.OR
on 27 May 2014 at 11:42
- Changed state: Invalid
from crypto-js.
Related Issues (20)
- DES and 3DES work only on alphabets
- CryptoJS.SHA3 does not pass any Keccak test vectors, it is completely broken HOT 2
- Unnecessary padding HOT 3
- AES encrypted string to be converted to base 64 string and then to byte array in Javascript
- Uncaught TypeError: Cannot read property 'init' of undefined HOT 1
- Clarify license HOT 2
- Automatic key expiration
- Type a is undefined in rollup version of aes.js line 27. HOT 4
- Crypto.JS PBKDF2 Results Differnt then .Net Rfc2898DeriveBytes HOT 1
- Crypto-js decryption implemention HOT 1
- Most of the hashs wont works regarding file encoding HOT 4
- Not able to decrypt the encrypted data on server side which was encrypted using CryproJS on client side..
- TripleDES result is different each time, and is not correct
- AES 256 decrypt from data oracle function encrypting HOT 1
- Broken hashing with sigBytes< bytes
- Error: Unable to get property 'createEncryptor' of undefined or null reference
- [IE8]Object doesn't support property or method
- decrypt of ciphertext not working for strings HOT 1
- [documentation] Add recommendation to use https
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crypto-js.