0

i'm locking for an alternative of CryptoJS.lib.WordArray in C#, exactly WordArray.random that generate random salt for encryption (see_more).

if (!salt) {
                salt = WordArray.random(64/8);
            }

this code is from cryptojs/cipher-core.js

Thank you

THEDOCTOR
  • 23
  • 5
  • Duplicate of [How can I generate a cryptographically secure pseudorandom number in C#?](https://stackoverflow.com/questions/1668353/how-can-i-generate-a-cryptographically-secure-pseudorandom-number-in-c) – Topaco Aug 10 '21 at 20:45
  • Do they have the same behavior ? _Wordarray_ code is available but not _RNGCryptoServiceProvider_ . – THEDOCTOR Aug 11 '21 at 07:47
  • `WordArray` is a type that CryptoJS uses _internally_. For what do you need a `WordArray` in C#? With `CryptoJS.lib.WordArray.random()` you create (pseudo) random data in CryptoJS. The counterpart in C# is e.g. `RNGCryptoServiceProvider`. – Topaco Aug 11 '21 at 08:09

0 Answers0