I enountered a problem where I was attempting to derive a 256bit key from an input password in hopes to use it with crypto.createCipheriv/createDecipheriv. This gives me the following error: [ERR_INVALID_ARG_TYPE]: the "key" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Recieved undefined I am not sure why... this.key = crypto.scrypt(this.passphrase, 'baewithsalt',256, (err)=>{if(err) throw err;}); when being used in... this.decipher = crypto.createDecipher(this.algorithm, this.key, this.iv); is telling me the key is undefined. I have these variables initialized just above that... this.passphrase ='whatever'; this.algorithm = 'aes-256-cbc'; this.iv =crypto.randomBytes(16); what am I doing wrong and why can't I use scrypt to generate a key from a password for cipheriv/decipheriv? I apologize if the format may be slightly off, my internet is out and I typed it through my phone.
crypto.scrypt -> createDecipheriv -> error. NodeJS
308 Views Asked by 4N0M41Y At
0
There are 0 best solutions below
Related Questions in NODE.JS
- How to solve CERT_UNTRUSTED error in nodemailer
- Run a loop over a callback, node js
- Implementing prerender.io middleware in sails.js
- Token based authorization in nodejs/ExpressJs and Angular(Single Page Application)
- formatting path string in javascript
- One to One screensharing using WEBRTC
- Create polygon from grid (for collisions)
- Strange npm behavior when installing packages like grunt
- Convert JSON.gz to JSON in node js
- "Your npm version is outdated." but it's not. While install yo
- Why put methods on the prototype of a class instead of declaring them in the constructor?
- Node JS Async Response
- mongoose get property from nested schema after `group`
- Cannot Receive Incoming call on Twilio android Client
- How can I change a specific line in a file with node js?
Related Questions in CRYPTOGRAPHY
- Do I have to randomize key in OpenSSL
- An exception of type 'System.Security.Cryptography.CryptographicException': keyset does not exist
- crypto.BadPaddingException: data hash wrong (EKYC-Response)
- Decrypted string returns "Length of the data to decrypt is invalid"
- Generate signature using private key with OpenSSL API
- Recovering an ECPublicKey from Java to JavaCard
- Proxy tool for CoAP integrated with DTLS
- Using CmsEnvelopedData with CmsSignedData to verify signed data
- Unchecked returned value causing unexpected states and conditions
- SQL-Server Verify SHA2_512 hash procedure
- SagePay Protocol 3.00 Encryption Error with ASP.NET
- Encrypting with PHP; decrypting with CryptoJS
- How can I write a function to recreate the original text obscured here by css magic?
- What encoding does [BouncyCastle] PKCS10CertificationRequest.getEncoded() return?
- Is integer comparison in Python constant time?
Related Questions in AES
- Do I have to randomize key in OpenSSL
- AES 256 and Base64 Encrypted string works on iOS 8 but truncated on iOS 7
- Encrypting (large) files in PHP with openSSL
- 32-character PHP AES Key for mcrypt_encrypt
- Javascript library forge does not work in Internet Explorer IE8
- ImportError: No module named Crypto
- AES CBC - Have message input and output and IV and have to find key
- AES with PKCS#5 padding
- Sage Pay Forms V3.00 AES-128 Encryption VB.Net
- C# AES and RSA File Encryption - How to use IV?
- Sagepay 2.22 to 3.00 form upgrade - PHP update to AES encryption
- vb.net AES decryption returns "data is incomplete block"
- Symmetric encryption (AES) in Apache Thrift
- Can I specify the nonce and counter in AES encryption counter mode?
- Encryption decryption with AES Crypto-JS does not work in an android webview?
Related Questions in CRYPTOAPI
- Sign with private key and verify with public
- How do I load an OpenSSL-generated RSA1024 plaintext public key with the CryptoAPI?
- How to determine hash and encryption algorithm of S/MIME message with Win32 CryptoAPI?
- Wrong result for base64 string of HMAC_SHA1 using Crypto*** API
- Use AES CBC with NCrypt in windows
- Microsoft CryptoAPI not working in web service on Windows Server 2008 R2
- Java standard crypto API vs. specific provider (Bouncy Castle)
- How to sign data using blackberry cryptography
- Caused by: java.security.KeyException: Bad Data
- Decrypt using a non-exportable private key with CryptoAPI
- How to get certificate serial number using vc++
- How to determine which personal certificate comes from hardware device in C#?
- STATUS_INVALID_PARAMETER error import diffie hellman public key using BCryptImportKeyPair
- BCryptImportKeyPair returns STATUS_INVALID_PARAMETER when i try to import public key
- What is the certificate store where my USB Token is listed? (Crypto API)
Related Questions in SCRYPT
- Configure Scrypt in Gradle for x86 android devices
- scrypt T-SQL Function
- OS X/Php - Extensions not loading
- Adding scrypt to Objective-C project
- Does the Bouncy Castle SCrypt implementation include the factors in the result?
- How to convert Bouncy Castle SCrypt Byte array to String format or HexString format?
- Why stepping over the SCrypt.generate() (Bouncy Castle Java API) line using breakpoint(Eclipse) blocks the debugging process?
- Scrypt hash algorithm for password hashing in Swift 3.0 (iOS)
- Usage of Firebase SCrypt params in nodejs scrypt package
- Converting WarpWallet's hashing algorithm from javascript into C#
- .NET implementation of scrypt
- Trouble storing scrypted password in MongoDB
- Propability formular for scrypt blocks
- Why is `lookup_gap=2` faster than `lookup_gap=1` when memory is enough
- Scrypt algorithm output doesen't match up as expected
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?