Giter Club home page Giter Club logo

Comments (5)

skeggse avatar skeggse commented on August 23, 2024

Your encrypted data uses PKSC7, but the example rijndael script uses null-padding.

from node-rijndael.

Applebit avatar Applebit commented on August 23, 2024

I am sorry your code didn't work even with
paddingmode.None
or
paddingmode.Zeros

from node-rijndael.

skeggse avatar skeggse commented on August 23, 2024

What is the default block size for RijndaelManaged? Please post your sample data when using paddingmode.Zeros and a block size of 256 bits.

from node-rijndael.

Applebit avatar Applebit commented on August 23, 2024

The default block size for the RijndaelManaged algorithms is 128 bits.

Here is the parameterless constructor of Rijndeal class (RijndaelManaged inherits form that class)
protected Rijndael()
{
this.KeySizeValue = 256;
this.BlockSizeValue = 128;
this.FeedbackSizeValue = this.BlockSizeValue;
this.LegalBlockSizesValue = Rijndael.s_legalBlockSizes;
this.LegalKeySizesValue = Rijndael.s_legalKeySizes;
}

for more info please follow
https://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged(v=vs.110).aspx

//sample data
Here all the information is base64 string and assuming paddingmode Zeros with KeySize 256 bit.
Rindael IV is +rNLB50lMq/Hc25cSN9avg==
Rindeal Key is oQNF+m9WVjIEL+ZS1l5h7AZLtzpnjTpxpyA1l3xju9c=
Encrypted cipher is 0BUtWkgiGCXW6hJi9g8nww==

The expected output after decryption is "Hello, World!"(quotes for clarity).

from node-rijndael.

skeggse avatar skeggse commented on August 23, 2024

This library only supports rijndael with a block size of 256-bits, and you're using RijndaelManaged with a block size of 128-bits, so your use-case is not supported.

AES is a form of rijndael that only supports a 128-bit block size. You should check out the built-in crypto library.

from node-rijndael.

Related Issues (9)

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.