Questions tagged [openssl]
OpenSSL is an open source implementation of the SSL and TLS protocols. Questions about how to use the OpenSSL tools and libraries are usually better asked at Stack Overflow or Super User.
369
questions
148
votes
1
answer
234k
views
What are the differences between .pem, .csr, .key, .crt and other such file extensions?
I'm new to SSL / TLS, and I want to work with the OpenSSL toolkit.
What do .pem and .csr stand for?
I do know that ...
49
votes
1
answer
105k
views
AES256-GCM - can someone explain how to use it securely (ruby)
I am looking into using AES256-GCM for encrypting some database fields. I know that for AES256-CBC, I need to generate a new IV for each encrypt, but I can use the same key. The IV can be openly ...
25
votes
1
answer
18k
views
Is openssl rand command cryptographically secure?
I'm wondering if the openssl rand command produces cryptographically secure random bytes. For example when in need for a random password or token:
...
17
votes
1
answer
11k
views
What to watch for with openssl generating weak keys? (low entropy)
(Disclaimer: I am regular software engineer with only basic crypto knowledge, so helpful if can be explained for a layman.)
I am concerned about generating weak keys on a shared linux box with ...
14
votes
2
answers
4k
views
Which crypto libraries/programs do we have the most confidence in? [closed]
I have recently begun studying crypto. If it's one thing I have learned it's that we should not implement our own crypto. Therefore we should look to using existing software and libraries.
When I go ...
13
votes
1
answer
19k
views
Why does OpenSSL append extra bytes when encrypting with aes-128-ecb?
Plaintext:
Attack at dawn!!
Hex:
41747461636b206174206461776e2121
Key:
...
13
votes
3
answers
13k
views
Anatomy of an RSA private key
I'm learning about OpenSSL and public key infrastructure and am curious about the structure of an RSA key and how it's related to its corresponding public key.
I can generate a private RSA key with ...
12
votes
3
answers
16k
views
How vulnerable is the C rand() in public cryptography protocols?
I just learned about the basics of public cryptography a few weeks ago and I am curious as to why the C rand() function should not be used for crypto schemes. For example, say I want to generate a ...
11
votes
1
answer
2k
views
Why do crypto tools display key components in such an unusual format?
openssl x509 (v1.0.1f) displays public key moduli as arrays of hex-encoded bytes, 15 columns wide, starting with a leading 00::
...
11
votes
2
answers
843
views
RSA Private Exponent Generation according to FIPS 186-4 in openssl v1
I guess this is more of a math problem in a cryptography context so I apologize beforehand if it is not the right place to ask. Basically I have to check whether a certain implementation of RSA key-...
10
votes
3
answers
9k
views
What is different below two Ciphersuites?
I have two questions;
I need an explanation for the differences of below two cipher suites.
How do they work with SSL/TLS protocol? (my main concern first one doesn't have '...
10
votes
2
answers
7k
views
How to derive a symmetric key from ECDH shared secret?
I am trying to implement the internal primitives of ECDH. Currently I'm able to multiply the receiver's public EC point with the sender's private key to arrive at the shared EC point. Next step is to ...
10
votes
2
answers
10k
views
Good entropy source for generating openssl keys
I need to generate a CA (4096-bit RSA) and server keys for openvpn and I want them to be "top quality". Here is my plan:
gather entropy from multiple sources (saving individual files): FreeBSD Yarrow,...
9
votes
3
answers
6k
views
Why does OpenSSL differentiate between PSS and non-PSS for private key generation?
RSA-PSS private keys
The following command will generate an RSA-PSS private key:
...
9
votes
3
answers
2k
views
Does this RSA decryption scheme make sense?
A custom file format has a header encrypted with a 2048-bit RSA public key. I need to decrypt it using a 2048-bit RSA private key. The header has 48 bytes, and according to the scheme I got for the ...
9
votes
2
answers
6k
views
Leaving authentication data blank less secure for AES GCM?
The AES GCM example for Ruby / OpenSSL shown at: http://ruby-doc.org/stdlib-2.0/libdoc/openssl/rdoc/OpenSSL/Cipher.html has a GCM example of the following:
...
9
votes
1
answer
20k
views
How does TLS_FALLBACK_SCSV help?
After reading through https://datatracker.ietf.org/doc/html/draft-ietf-tls-downgrade-scsv-0, I could understand that this option is recommened for use when one has legacy SSL Servers which only ...
9
votes
2
answers
6k
views
Complete Set of Test-Vectors for ECDSA secp256k1
Although there are several implementations of ECDSA secp256k1 public available over the internet (the most popular being OpenSSL), it seems that there are no complete set of test-vectors available.
...
8
votes
1
answer
3k
views
How is OID 2a 86 48 86 f7 0d parsed as 1.2.840.113549?
I saw that an RSA key, created by OpenSSL, contains the following HEX string:
2a 86 48 86 f7 0d 01 01 01
that HEX string gets interpreted as Object ID:
1.2.840.113549.1.1.1
It is obvious 01 01 ...
8
votes
2
answers
11k
views
What are KDF parameters in OpenSSL command-line utility for `enc`?
I refer to https://www.openssl.org/docs/manmaster/apps/enc.html and see that the only parameter for key derivation which I can set explicitly (not considering the obvious ...
8
votes
1
answer
8k
views
Sending TLS messages with out encryption using openssl code
Is it possible to send messages over TLS with out encryption?
If so which cipher suite is needed for this?
8
votes
3
answers
3k
views
Explanation of openssl ciphersuites
I'm looking for a detailed explanation of the ciphersuites available in openssl.
openssl already offers the ciphers command which can be used to output, for example, the following:
...
7
votes
2
answers
19k
views
With OpenSSL and ECDHE, how to show the actual curve being used?
Using
openssl s_client -host myserver.net -port 443
I can see the cipher negotiated is indeed using ECDHE for session key ...
7
votes
2
answers
6k
views
Calculate the RSA private exponent from the CRT parameters
I am trying to make the RSA structure of Openssl manually, knowing
the public key ($n$, $e$) and the CRT parameters $p$, $q$, $d_P$, $d_Q$, and $u = q^{-1} \mod p$.
That is, I want to get the $d$ ...
7
votes
2
answers
1k
views
Implement deniable encryption with AES/RSA
I'm on a crypto app using OpenSSL (I'm more an implementer/cryptographer than a cryptologist), mainly as a hobby, for now.
My app will be able to encrypt a file (not a container) with symmetric or ...
7
votes
1
answer
60k
views
How to decrypt a '.enc' file that has been encrypted with RSA using a public key? [closed]
While solving a CTF challenge online, I came across a situation where I needed to decrypt a '.enc' file that has been encrypted using someone's public key. The ...
7
votes
1
answer
3k
views
ECC considered secure in OpenSSL?
If I perform the following command:
openssl ecparam -list_curves
using my OpenSSL version (1.0.1f), it spits out the following supported curves:
...
7
votes
1
answer
1k
views
Blind signature with openssl
I'm trying to understand (to reproduce in practice) how does blinded tokens work. Currently i'm lacking examples. According to Wiki the blinded signature protocol is the same as ordinary signature ...
6
votes
2
answers
963
views
Is encrypting credit card numbers one by one with rsautl secure?
I wish to encrypt credit card numbers one by one using asymmetric encryption on the command line. My current approach is this…
Encrypt:
...
6
votes
1
answer
15k
views
Why is OpenSSL generated 256-bit AES key 64 characters in length?
This might be a noob question, but I couldn't find its answer anywhere online: why does an OpenSSL generated 256-bit AES key have 64 characters? The command I'm using to generate the key is:
...
6
votes
1
answer
10k
views
curve25519 by openSSL
How can i generate ec curve25519 keys using openSSL?
When I run
openssl ecparam -name curve25519 -genkey -noout -out private.ec.key
I have this message
...
6
votes
2
answers
7k
views
How does OpenSSL know if a decryption failed? [closed]
I have a file full of garbage, random data, and I encrypt it with AES256:
openssl -in myfile -out encfile -aes256 -pass pass:abc123
If I try to decrypt it with ...
6
votes
1
answer
544
views
Difference RSA keypair creation openSSL and openPGP?
Creating a 2048bits RSA keypair I figured that doing this using
openssl takes as an input 32bytes of "randomness" from ...
6
votes
2
answers
2k
views
Which elements of private RSA file are really constitutive of private key?
I have used openssl rsa to generate a RSA key of 2048 bits and as expected output belongs to a file beginning with ...
6
votes
1
answer
3k
views
Nonce for AES GCM to prevent replay attacks
I am wanting to encrypt a message with a pre shared key that uses AES GCM from the OpenSSL library to do so.
I generate my key for the AES crypto via hashing my pre shared key with a salt using the <...
6
votes
2
answers
748
views
What may be causing conflicts in Whirlpool implementation versions?
I see by layman articles (e.g. at Wikipedia) that the Whirlpool hash function has seemingly three current versions. That is to say, they are referenced as ...
6
votes
3
answers
18k
views
Is there a complete list of Signature Algorithm names?
I need to analyze the output of rbsec's sslscan which reports a server's SSL/TLS configuration as reported by OpenSSL.
I'm interested in the Certificate's Signature Algorithm in particular, and I was ...
6
votes
1
answer
837
views
OpenSSL FIPS integrity check
As far as I know, FIPS requires a set of self tests (POST) to verify the cryptographic algorithms permitted and the integrity of the module.
These tests are performed at run-time, so OpenSSL does a ...
6
votes
1
answer
920
views
How to exctract ECDH parameters from an OpenSSL-generated $G$?
I'm using ECDH for generating ECDH public parameters (p,a,b,G,n), I try to get this values using openssl ecparam -in cert.pem -text -noout
For ...
5
votes
3
answers
3k
views
Is it possible to decrypt the 2nd byte of AES-256-CFB-8 ciphertext without decrypting the 1st byte?
I am stuck with AES-CFB decryption.
Assume I encrypted plaintext helloworld (10 bytes) using AES-CFB.
Now I want to decrypt the second byte ...
5
votes
1
answer
9k
views
Static DH/Static ECDH certificate using OpenSSL
I've been searching for some time and have found no way to create a working certificate and private key pair with a DH or ECDH public key using OpenSSL. Once I do this, I'd like to sign it with an RSA ...
5
votes
3
answers
1k
views
Theoretical Approaches to crack large files encrypted with AES
I have a large file (> 200 Gb), that I encrypted a while ago with AES-256-CBC. The file itself is a tar which I ran through ...
5
votes
3
answers
3k
views
ChaCha20-Poly1305 test vectors
I was trying to use OpenSSL 1.1 (via Ruby) to validate the ChaCha20-Poly1305 test vector from this IETF draft: https://datatracker.ietf.org/doc/html/draft-agl-tls-chacha20poly1305-04#section-7
The ...
5
votes
2
answers
2k
views
Security of non-standard use for AES-256-CTR?
I have a string secret that I would like to encrypt for storage in a Yubikey's second slot. These slots can be configured to store up to 38 characters that are later "typed" by the USB device acting ...
5
votes
1
answer
2k
views
Do aes_256_gcm IVs just need to be unique for that key?
I'm using GCM (via openssl's EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL))).
The IV's default length is 12 bytes.
It says that the IV must be ...
5
votes
1
answer
173
views
How is SSL secure?
if the client and the server need to exchange keys and I can sniff it, wouldn't I be able to decrypt the data transported?
5
votes
3
answers
4k
views
Can a billion elliptic curve keys be generated on a laptop in less than an hour?
I want my application to generate an EC key pair.
The first four bytes of the sha256 hash of the public key should contain a known IP address.
As hashes are one-way functions, I need to brute force ...
5
votes
1
answer
3k
views
Decrypting AES256-CBC with wrong encryption key
Using OpenSSL library is there any chance that decrypting AES256-CBC encrypted data with wrong encryption key will succeed without an error?
Asking this because I have read somewhere there is 1/256 ...
5
votes
1
answer
5k
views
DSS security in comparison to ECDSA or RSA
OpenVPN allows the users to choose the TLS cipher suite, depending on the deployed SSL/TLS library. With OpenSSL 1.0.2g and OpenVPN 2.3.11 this is a rather long list (Full list).
Amongst the many ...
5
votes
1
answer
6k
views
Shouldn't a signature using ECDSA be exactly 96 bytes, not 102 or 103?
Attempting to use openssl to create a signature is confusing on several levels:
If I'm using it to sign a hash that I've already created (HMAC-SHA-384-192, specifically),
a. why must I specify ...