Giter Club home page Giter Club logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.