I would like to use AES_256_GCM in my software. The OpenSSL wiki page gives me an example: wiki page.
It shows that only function EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv) uses key.
My key is SHA3_256 hash of a password (Qt implementation of SHA3_256).
I would like to know if I have to use PKCS#5 to randomize the key or the function takes care of that.
Do I have to randomize key in OpenSSL
283 Views Asked by MKAROL At
1
There are 1 best solutions below
Related Questions in OPENSSL
- Do I have to randomize key in OpenSSL
- SoapClient in PHP 5.6 when using HTTPS emits warning with "key values mismatch"
- Sign with private key and verify with public
- CloudSQL SSL connection error
- What is the correct way to pass the password to OpenSSL
- Ruby using wrong version of openssl
- Trying to create a certificate through openssl using shell_exec in PHP
- Decrypt Amazon Redshift CSV dump
- Generate signature using private key with OpenSSL API
- Google reCaptcha with php validation
- OpenSSL file transfer
- Verify a RSA public key in OpenSSL?
- Non-blocking SSL socket negotiation in Ruby. Possible?
- openssl_pkey_get_public return 0
- gem eventmachine fatal error: 'openssl/ssl.h' file not found
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 PASSWORDS
- Do I have to randomize key in OpenSSL
- Xcode salting and hashing a password
- migrate one ldap server to another - questions
- Create a .txt with Password
- Hiding param of struts.xml values in Struts 2
- Detecting when CAPS LOCK is ON
- Save user and password Android
- Use MATLAB's webread to login to website and extract text
- authentication ruby valid_password error
- Linux acquire root permissions through a password popup
- I forgot the password to open a Word document. How can I retrieve the password?
- Django Rest Framework - serializer code not executing
- Transmit commands via ssh with password using expect
- Most used password in different language
- How does Maven 3 password encryption work?
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 PKCS#5
- PartialChain error in X509Chain when building certificate chain?
- Why are there no extensions in the CertificateExtensions property of CertificateRequest?
- Compute sign using secure token hit Unknown error -1073741275 using sha256 algo
- Go TLS x509: no DEK-Info header in block even if using pkcs8
- What is the accepted way to transfer public-private keypairs over intranet?
- Problem with cURL in PKCS11 with USB TOKEN
- C# Decrypt AES CBC pkcs1 padding, there is System.Security.Cryptography.PaddingMode.PKCS7 but does not have PKCS1
- How can i get public key in DER format from base64 encoded public key?
- Decryption error while Decrypt the symmetric key
- Meaning of algorithm properties in a certificate
- Azure Function Could not load file or assembly 'System.Security.Cryptography.Pkcs'
- convert pkcs1 signature to pkcs7 signature using nodejs
- OpenSSL.crypto.Error when trying to load certificate from Azure Key Vault
- problem in importing private key to the token
- How to check pkcs format of a private key using golang code?
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?
You should probably digest the password into a key with OpenSSL's
PKCS5_PBKDF2_HMAC_SHA1. See How to use PKCS5_PBKDF2_HMAC_SHA1().Each encryption of a string or file should get its own random IV. IVs cannot repeat. Your other option is to use a random key for each string or file.
The output of the encrypt operation is the
{IV,CipherText}pair.AES_256_GCMis a good choice. One of the few ways it could get better is with an Integrated Encryption Scheme. You might take a look at openssl-pkey-ec-ies on GitHub. Crypto++ and BouncyCastle also have Elliptic Curve Integrated Encryption Scheme implementations, so you have other choices.Be sure to test interop. They interop, but it takes some knob turning. The problem with interop is there are so many standards providing it, and each is slightly non-interoperable.
To give you an idea of the nuances, ECIES calls out that a particular variable gets hashed (its the length of a given string of data). One standard represents the variable in 4 octets, another in 8 octets. That's the only difference and causes interop issues if you are not aware.