6,963 questions
115
votes
8
answers
126k
views
What RSA key length should I use for my SSL certificates?
I'm in the process of creating a CSR, and I wonder which is arguably the best length for my RSA key.
Of course, 384 is probably too weak, and 16384 is probably too slow.
Is there a consensus on the ...
0
votes
0
answers
75
views
Dart SecurityContext not accepting programmatically generated RSA private key for Android TV Remote Protocol
I'm building a Flutter app that uses Android TV Remote Protocol v2. The app requires client certificates for authentication. When I use a manually created certificate (placed in assets), everything ...
3
votes
1
answer
11k
views
golang JWT No Signature. "crypto/rsa: verification error"
I'm using JWT. This is how I create the token.
func createToken(user User) (string, error) {
token := jwt.New(jwt.GetSigningMethod("RS256"))
token.Claims["Name"] = user.Name
token.Claims[...
1
vote
0
answers
528
views
Self-signed Certificate on Android with Spongy Castle
I'm creating a self signed certificate on Android using SpongyCastle.
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA", "BC");
ContentSigner sigGen = new ...
12
votes
1
answer
30k
views
What is the maximum length of private and public RSA keys?
I am generating private and public keys using OpenSSL in PHP, which I intend to store in a database (although you probably don't need to know PHP to answer this question).
They look like this:
-----...
1
vote
0
answers
78
views
RSA based certs failing during TLS after removal of RSA-PSS ciphers from ClientSignatureAlgorithm
For FIPS mode, I added ClientSignatureAlgorithm in opensslcnf.txt. This change was done for FIPS mode using the crypto-policies package.
The support ciphers for ClientSignatureAlgorithms are same as ...
151
votes
7
answers
135k
views
How do you use an identity file with rsync? [closed]
How do you use an identity file with rsync?
This is the syntax I think I should be using with rsync to use an identity file to connect:
rsync -avz -e 'ssh -p1234 -i ~/.ssh/1234-identity' \
"/local/...
2
votes
1
answer
9k
views
RSA encryption, decryption functions for Arduino
I need encrypt data with RSA using public key and decrypt using private key. Public and private keys generation not needed. I know that algorithm require computing resources, but I use only 32-128-bit ...
16
votes
2
answers
39k
views
Python Cryptography module save/load RSA keys to/from file
Using the Cryptography module for Python,
I want to save my generated private key in a file, to use it later on.
But from the docs I was unable to find the method needed for this.
from ...
0
votes
1
answer
1k
views
javax.crypto.BadPaddingException: Decryption Error - Not able to decrypt multiple blocks from file
Hoping somebody can point me in the right direction here.
I'm not particularly familiar with encryption (in Java or otherwise), but I said that I'd help somebody out with a task they have that ...
-1
votes
1
answer
268
views
Can anyone other than web client calculate the fingerprint of a digital certificate? And figure out CA’s private key from fingerprint signature pairs? [closed]
From what I understand, a web server sends a CSR to a CA, which contains web server’s RSA public key and identity (subject, CN etc.). CA adds some more information (e.g. issuer, validity dates), signs ...
2
votes
2
answers
10k
views
RSA Encryption and Decryption with X509certificate2
So, what I need is next:
Create certifiactes for development, get one for the client and one for server
Retrieve password through API that is encoded from client and decode it on server
Now, I managed ...
0
votes
1
answer
133
views
rsa.ImportFromPem(privateKeyString) throws strange error in ASP.NET Core 6.0 Web API [closed]
using (RSA rsa = RSA.Create())
{
rsa.ImportFromPem(privateKeyString);
byte[] dataToSign = Encoding.UTF8.GetBytes(signData);
byte[] signedData = rsa.SignData(dataToSign, HashAlgorithmName....
10
votes
1
answer
12k
views
how to .net core RSA pem to xml?
recently i got project need run it on .net core 1.1. i realize that RSACryptoServiceProvider is not exsit on .net core RSA class.
after i search in stackoverflow only few result as below =>
How to ...
6
votes
1
answer
12k
views
Creating RSA public/private key pair with Bouncy Castle or .Net RSACryptoServiceProvider
So I've messed around a bit with .Net's RSACryptoServiceProvider and Bouncy Castle to be able to create RSA key pairs and later on X509 certificates.
I'm just curious if anyone knows if there's any ...
2
votes
2
answers
4k
views
Python library for RSA public decryption [closed]
I'm searching for a python library that is capable if decrypting and encrypting RSA (RSA_PKCS1_PADDING to be precise) with a public key. I've aleready tried pycryptodome, cryptography and rsa and all ...
3
votes
3
answers
49k
views
ssh connect Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
I have a pair of keys to epadmin on machine A. I copied them on machine B in home folder of epadmin via scp in folder .ssh
command for access : ssh [email protected]
[epadmin@3A1D .ssh]$ ls -la
...
1
vote
1
answer
1k
views
What are the differences between `createSign()` and `privateEncrypt()` in `node:crypto` for RSA?
privateEncrypt() says "..., the padding property can be passed. Otherwise, this function uses RSA_PKCS1_PADDING." sign() says "padding Optional padding value for RSA, one of the ...
2
votes
2
answers
2k
views
LockBox 3 encrypt RSA with public certyficate
In Delphi 10.4 I am trying to encrypt string with RSA, using public key from certificate (*.cer).
The problem is that, I do not know, how to pass this certificate to RSA function.
I have feelings, ...
4
votes
3
answers
13k
views
How to Load a Key and Encrypt With RSA Swift
How could you load a public or private key from a file, and then encrypt or decrypt data with it in Swift while using no libraries or APIs?
0
votes
0
answers
90
views
Get date from TimeStampToken equivalent in Typescript
I have a web service that returns a Timestamp Token as a base64 string,
I have this code in Java using BouncyCastle to parse, open and extract the date:
String timestamp = "...";
byte[] ...
3
votes
2
answers
3k
views
Is there any way to generate PSS padded signatures in PHP?
In PHP, I want to sign some documents with a padding of PSS, and a digest of SHA512.
According to the docs, at http://www.php.net/manual/en/function.openssl-sign.php, I can set the digest however I ...
0
votes
0
answers
61
views
How to securely connect Flutter to a Node.js server with TLS or RSA encryption?
I'm building a Flutter app that needs to send user data (like name and street) to a Node.js backend server. Currently, the data is sent via URL like this:
http://192.168.1.126:8080/save?name=toto&...
1
vote
1
answer
82
views
inconsistency in RSA algorithm when using pycryptodome
I am using python3-pycryptodome version 3.9.0-150200.9.1 on openSUSE Leap version 15.6.
While using Crypto.PublicKey.RSA class, I noticed that generated RSA keys have some algorithmic inconsistency.
...
0
votes
1
answer
2k
views
Using RSA/ECB/OAEPPadding algorithm for encryption key not working in android
When I use the RSA/ECB/OAEPPadding algorithm in the encryption method below, an error gets thrown in Android:
Error:javax.crypto.IllegalBlockSizeException: error:04000072:RSA routines:OPENSSL_internal:...
0
votes
1
answer
17k
views
Convert p7b file into p12 file format
I have generated pem and csr files using the below command.
openssl req -newkey rsa:2048 -keyout key.pem -out req.csr
After this, I sent csr file to the authority and got p7b certificate.
Now, I tried ...
0
votes
0
answers
99
views
How to extract private part of RSA key from Azure Key Vault?
I'm using Java & Spring Boot for an endpoint which sole purpose is to create, sign and issue JWT. The library used for creating JWTs is java-jwt. I have a problem creating a com.auth0.jwt....
0
votes
1
answer
2k
views
How to add a custom RSA key pair to a .pem file
I created a custom RSA key pair just for test purposes in python. I want to add the private key and public key to a .pem file but I didnt find anything in my research. All i found is people generating ...
6
votes
2
answers
9k
views
Unable to load RSA public key
I'm trying to read RSA public key shown below, but I get an exception at line 6: java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: IOException: algid parse error, not a ...
24
votes
3
answers
8k
views
Are public key and private key interchangeable for RSA?
On the one hand, I hear people saying that the two keys are totally interchangeable, the first one will decrypt what the second one encrypted. This makes me think that the two keys are interchangeable....
0
votes
0
answers
74
views
TCP socket server hangs randomly and rsa Decryption error raised randomly
I'm trying to make a server for a password manager I'm building, but the server seems to hang randomly and it seems to randomly throw rsa.pkcs1.DecryptionErrors randomly too. I did recently switch ...
0
votes
0
answers
92
views
Cybersource microform upgrade from V0.4 to V2 -Validation of the Context key with the public key is getting failed
Here is the class that am using ,based on the flow that I have ,the validation always fails and return false in the line boolean isValid = signature.verify(signatureBytes);
LOG.info("Signature ...
0
votes
2
answers
620
views
What is DSA complexity? [closed]
I have made some testing and it came out that RSA is lot slower than DSA.
What is usual DSA time complexity?
RSA[ms] DSA [ms]
1125 218 1KiB
1047 188 2KiB
594 17 4KiB
641 234 8KiB
...
6
votes
1
answer
14k
views
How to generate RSA Private key from *pem string in Java [duplicate]
I want to generate the private key from a string(a .pem file) in Java.
private static final String test = "-----BEGIN RSA PRIVATE KEY-----\n" +
"...
1
vote
1
answer
752
views
Alternatives to Windows Crypto API for C# RSA PKI? [closed]
I'm building a secure WhatsApp-like messenger for me and my friends. It encrypts all messages with AES and then uses RSA to encrypt the random AES key, it's very similar to PGP. For the desktop client,...
0
votes
0
answers
129
views
AES + RSA OTA updater
I am doing an OTA updater for an ESP32. I am using AWS Lambda to encrypt a presigned URL that is being generated for a certain element from an S3 bucket. I am first doing an AES encryption, and then ...
6
votes
2
answers
7k
views
How do I extract the private key components $N$ and $D$ from a private RSA key?
I have a private RSA key like – for example – this one:
-----BEGIN RSA PRIVATE KEY-----
MIIBOgIBAAJBAMPMNNpbZZddeT/GTjU0PWuuN9VEGpxXJTAkmZY02o8238fQ2ynt
N40FVl08YksWBO/74XEjU30mAjuaz/...
19
votes
3
answers
42k
views
Why use `-t rsa -b 4096` with ssh-keygen?
Why should I use the options, -t rsa, -b 4096, and -C "[email protected]" when creating an SSH key, as instructed by github? If I create an SSH key without these options, is it less secure? If so, ...
0
votes
0
answers
87
views
RSA with nodejs and flutter Error during decryption (probably incorrect key). Original error: Error: error:02000079:rsa routines::oaep decoding error
I am experimenting with developing rsa with flutter and nodejs. public.pem and private.pem are same for both. Both the code are working fine when run in same language. but when transmitting data over ...
0
votes
0
answers
117
views
TR34 Sample Enveloped Data
I have a TR34 sample enveloped data from X9 TR34–2012.
I am trying to decrypt it, but I am not sure which part of the token contains encrypted ephemeral key and which exact rsa algorithm is used for ...
-4
votes
2
answers
286
views
What is advantage of implementing RSA cryptography algorithm on FPGAs? [closed]
RSA , no doubt, has several applications and is very famous. And today we use 2048-bit RSA key for security purposes. Yet, I see several research papers implementing RSA algorithm with 32-bit key (or ...
7
votes
1
answer
23k
views
JAVA: How to save a private key in a pem file with password protection
I am trying to save a private key in a pem file, protected with a password. The problem is, the pem file is created and I
can even open it with openssl but, no password is asked!
Here is the code:
...
4
votes
3
answers
10k
views
Unable to cast object of type 'Org.BouncyCastle.Crypto.AsymmetricCipherKeyPair' to type 'Org.BouncyCastle.Crypto.Parameters.RsaKeyParameters'
Here is the code which is working fine when reading file from the txt but when i read it from the string i am getting the error here
public string encrypt(string plainText,string PrivateKey)
...
7
votes
2
answers
13k
views
RSA Decryption exception: The length of the data to decrypt is not valid for the size of this key
I have got an Angular + Net Core application with an (RSA + AES) encrypted connection.
All requests from client are coming via POST. (You will be given an example below.
The script provided below ...
0
votes
0
answers
53
views
Input format for public key in EU command on payShield 10K
I'm working with a Thales payShield 10K and trying to use the EU command to translate a public key under new LMK.
I currently have the key available in PEM, DER, and HEX formats. However, according to ...
2
votes
1
answer
4k
views
Java RSA decryption javax.crypto.IllegalBlockSizeException: Data must not be longer than 256 bytes
Small RSA decryption question with Java please.
I want to meet in a secret location with a friend of mine.
As we do not want anyone to eavesdrop on the secret location, I generated a RSA key pair, a ...
-2
votes
1
answer
110
views
Key unwrapping fails
I want to protect a RSA private key stored in localStorage by wrapping it with a key derived from the user's password.
However when unwrapping the key the error DOMException: An invalid or illegal ...
1
vote
1
answer
90
views
Can't align RSA encryption in Python and Kotlin
I would like to add RSA encryption in my server (Python FastAPI) and my Android app.
But the encryption didn't work as the way I expected.
I already have AES-GCM encryption/decryption working between ...
14
votes
4
answers
11k
views
Small RSA or DSA lib without dependencies
Is there a small library for RSA or DSA without any dependencies like GMP or OpenSSL? (Written in C or Asm)
1
vote
1
answer
1k
views
Shell script to decrypt file
I have to create a Shell script that can decrypt a RSA key file that is encrypted with a specific .pem file. And then to decrypt .zip file with the AES key which I get from the RSA file once it is ...