Questions tagged [encryption-asymmetric]

A type of encryption which uses one key to encrypt a message and another to decrypt the message.

In asymmetric encryption, also referred as public-key cryptography, there are two related keys--a key pair. A public key is made freely available to anyone who might want to send you a message. A second, private key is kept secret, so that only you know it.

594 questions
318
votes
7 answers

Truststore and Keystore Definitions

What's the difference between a keystore and a truststore?
Rob Wright
  • 3,374
  • 2
  • 18
  • 12
162
votes
5 answers

encryption/decryption with multiple keys

Is it possible to encrypt data, such that it can be decrypted with several different keys? Example: I've encrypted data with key1, but I want to be able to decrypt with keys 2, 3, and 4. Is this possible?
Glen Solsberry
  • 11,960
  • 15
  • 69
  • 94
70
votes
10 answers

Given a private key, is it possible to derive its public key?

From whatever little I understand by reading various material, public-private key pair are the basis of asymmetric encryption and also something about choosing 2 prime numbers (which is roughly your private key) and multiplying them (which is…
Hemant
  • 19,486
  • 24
  • 91
  • 127
68
votes
4 answers

RSA Encryption, getting bad length

When calling the following function : byte[] bytes = rsa.Encrypt(System.Text.UTF8Encoding.UTF8.GetBytes(stringToEncrypt), true); I am now getting the error: bad length. With a smaller string it works, any ideas what the problem could be the string…
JL.
  • 78,954
  • 126
  • 311
  • 459
60
votes
12 answers

Cracking short RSA keys

Given the following RSA keys, how does one go about determining what the values of p and q are? Public Key: (10142789312725007, 5) Private Key: (10142789312725007, 8114231289041741)
Donald T
  • 10,234
  • 17
  • 63
  • 91
57
votes
6 answers

Encrypting data with a public key in Node.js

I need to encrypt a string using a public key (.pem file), and then sign it using a private key (also a .pem). I am loading the .pem files fine: publicCert = fs.readFileSync(publicCertFile).toString(); But after hours of scouring Google, I can't…
Clint
  • 2,871
  • 2
  • 25
  • 28
45
votes
7 answers

how to use RSA to encrypt files (huge data) in C#

I'm new to encryption. I need to implement asymmetric encryption algorithm, which i think it uses private/public key. I started using a sample of RSACryptoServiceProvider. it was ok with small data to encrypt. But when using it on relatively larger…
ala
  • 7,070
  • 13
  • 47
  • 54
44
votes
5 answers

How to load the RSA public key from file in C#

I need to load the following RSA public key from a file for use with the RSACryptoServiceProvider class. How can I do this? -----BEGIN PUBLIC…
goodolddays
  • 2,595
  • 4
  • 34
  • 51
30
votes
3 answers

JWT Keys - Asymmetric and Symmetric

I understand the difference between symmetric and asymmetric keys. I understand that the keys are used to calculate the signature and then verify them. However diving a little deeper, I'd like to understand a bit more which I'm having trouble…
n00b
  • 5,843
  • 11
  • 52
  • 82
28
votes
6 answers

What is the purpose of using separate key pairs for signing and encryption?

Why do I need to use separate public key pairs for signing and encryption and not use the same key pair with RSA for example? Is there any security problem with using the same key?
gil regev
  • 281
  • 1
  • 3
  • 3
25
votes
4 answers

Ruby: file encryption/decryption with private/public keys

I am searching for an algorithm for file encryption/decryption which satisfies the following requirements: Algorithm must be reliable Algorithm should be fast for rather big files Private key can be generated by some parameter (for example,…
25
votes
5 answers

Are there any asymmetric encryption options for JavaScript?

I have to transfer some sensitive information over a JavaScript AJAX Call, over an unencrypted channel (HTTP, not HTTPS). I'd like to encrypt the data, but encryption on the JavaScript side means I expose the key, which makes symmetric encryption…
23
votes
4 answers

Private/Public Encryption in Python with Standard Library

Is there a module that has my searching has been unable to discover that would allow writing code like the following? The reason for wanting to write code like this is unimportant. All I am after is some code that has a simple API to generate public…
Noctis Skytower
  • 21,433
  • 16
  • 79
  • 117
22
votes
2 answers

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. But on the other hand, RSA generated keys…
qdii
  • 12,505
  • 10
  • 59
  • 116
20
votes
3 answers

How to make a simple public-key cryptographic algorithm?

I want to make a simple public-key(asymmetric) encryption. It doesn't have the be secure, I just want to understand the concepts behind them. For instance, I know simple symmetric ciphers can be made with an XOR. I saw in a thread on stackexchange…
1
2 3
39 40