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.

Filter by
Sorted by
Tagged with
30
votes
1answer
55k 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 ...
16
votes
1answer
10k 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 ...
12
votes
1answer
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
2answers
3k 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 ...
10
votes
1answer
14k views

Why does OpenSSL append extra bytes when encrypting with aes-128-ecb?

Plaintext: Attack at dawn!! Hex: 41747461636b206174206461776e2121 Key: ...
10
votes
1answer
3k 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: ...
10
votes
2answers
6k 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
2answers
4k 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
3answers
11k 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 ...
8
votes
2answers
7k 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
2answers
6k 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 ...
7
votes
2answers
15k 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
1answer
1k 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 ...
7
votes
2answers
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
3answers
1k 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
1answer
2k 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: ...
6
votes
3answers
1k 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: ...
6
votes
1answer
17k views

How does TLS_FALLBACK_SCSV help?

After reading through https://tools.ietf.org/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 support SSLv3. ...
6
votes
2answers
840 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
2answers
4k 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
1answer
493 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
1answer
2k 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
2answers
574 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
2answers
3k 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. ...
6
votes
1answer
622 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 ...
6
votes
1answer
46k 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 ...
6
votes
1answer
805 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 ...
5
votes
3answers
2k 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
1answer
6k 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
2answers
3k 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$ ...
5
votes
1answer
6k 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?
5
votes
2answers
735 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
1answer
162 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
2answers
3k 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 ...
5
votes
1answer
328 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 ...
5
votes
2answers
2k views

Why does openssl derive IVs from a password?

From https://wiki.openssl.org/index.php/Manual:Enc(1): When a password is being specified using one of the other options, the IV is generated from this password. Why does OpenSSL do this? My ...
5
votes
1answer
7k views

Encryption, Decryption using OpenSSL

How to use OpenSSL in windows for encryption and decryption ?
4
votes
3answers
2k 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 '...
4
votes
2answers
4k views

Openssl & RSA : how many public exponents are possible?

I would like to know if it is possible to set the public exponent we want with "OpenSSL RSA" or if it is really limited to 2 possible exponents: 3 65537 If yes, why ?
4
votes
3answers
1k 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://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-04#section-7 The relevant ...
4
votes
3answers
2k 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 ...
4
votes
1answer
587 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 ...
4
votes
1answer
3k views

Why is 224 bit ecdsa faster than 192 bit ecdsa?

I ran several benchmarks using openssl on 2 different computers and I got a surprising result. for the Nist 192 bit curve the benchmark result is ...
4
votes
1answer
2k views

Okay to use OpenSSL to encrypt then sign a message?

I am planning on encrypting a message then signing the message so the recipient can authenticate the source. Reading this article has me concerned that I'm doing something wrong. My current plan is ...
4
votes
1answer
1k views

The “openssl genrsa” command only generates a private key?

The command : openssl genrsa -out RootCA.key 4096 generates a single file named RootCA.key. When I open the file, it only contains the private key. Then ...
4
votes
1answer
2k 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 ...
4
votes
2answers
180 views

Are low security curves for ECDSA not supported?

I am working in a very bandwidth restricted environment, and we are looking to implement ECDSA digital signatures. Although they are no longer recommended, we might be looking to use curves that are ...
4
votes
1answer
227 views

How do I decide what mode to use?

I'll be using AES from OpenSSL. I understand why I don't want to use ECB from reading pages like this Wikipedia article, which has a great example of what happens when you attempt to encrypt with ...
4
votes
1answer
789 views

How to correctly encrypt data with proper authentication using AES-256-CBC in php?

I have been using the openssl function for encrypting data with AES-256-CBC in php. I have been able to encrypt it using an unique IV (by generating with openssl_random_pseudo_bytes)for each new ...
4
votes
1answer
621 views

Why a key pair is used in OpenSSL ECDSA_sign or ECDSA_do_sign instead of only private key ?

If the digital signature in ECC (ECDSA) is made using a private key, why is the OpenSSL library using ECKEY pair as an input parameter instead of the private key only ?