Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rsa]

an asymmetric (e.g. public-key) cryptosystem, based on modular exponentiation with big exponents and modulus. RSA can be used both for signature and encryption.

1
vote
1answer
26 views

Preferred SHA-2 hash algorithm for MGF1 in RSA

Does it make any difference to the security and efficiency if we use SHA-256 or SHA-512 for the Mask Generation Function MGF1 that generates the masking / padding within the OAEP encryption scheme and ...
6
votes
1answer
7k views

Should I be using PKCS1 v1.5 or PSS for RSA signatures?

I am implementing an application where a user needs to sign some data that they have created, store it in an untrusted place, then later retrieve that data and verify it is still authentic before ...
1
vote
1answer
30 views

Generate a per data shared secret vs per session

I have read about SSL that they persist the shared-secret for the entire session. However, someone in stackoverflow suggested a way of generating a shared secret for each data to send and then send ...
0
votes
1answer
52 views

Why is lcm(n) used now instead of $\varphi(n)$ in RSA? [duplicate]

I know that lcm(n) or Carmichael's totient function $\lambda(n)$ is now used instead of $\varphi(n)$ or Euler's totient function to generate the public key in RSA encryption? Why is this so? Are there ...
1
vote
1answer
63 views

Prime numbers in RSA encryption [duplicate]

I'm studying how the selection of prime numbers in RSA encryption may affect the security of the encryption in regards to the public key. Essentially, are there any specific types of prime numbers ...
-1
votes
2answers
1k views

How exactly are GPG keys (and prime numbers inside of GPG) mathematically related?

I know that the keys are somehow mathematically related, and I know that they're somehow generated via prime numbers, but how exactly are they related? I realize that it'd probably be best for me to ...
0
votes
2answers
80 views

How does AWS Secret key and access key work

Those keys are too short to be public/private RSA keys. What are they? How does it use them to authenticate the client? My guess is: AWS access key ID is a form of unique user/account identifier AWS ...
1
vote
1answer
46 views

Value of $\varphi(n)$ and $\lambda(n)$

Is it true that $\varphi(n)$ is generally larger than $\lambda(n)$ for the same $n$? If so, can anyone give me a proof?
0
votes
1answer
62 views

Do Carmichael's and Euler's totient functions in RSA generate the same keys?

Starting with the same primes $p$ and $q$ to generate $n=pq$, will Carmichael's totient function and Euler's totient function give the same public key ($e,n$) and private key ($d,n$) in RSA encryption?...
0
votes
0answers
19 views

Time complexity of Carmichael's totient function [duplicate]

I'm studying the efficiency of Euler's totient function and Carmichael's totient function used in RSA encryption. I do understand that Euler's totient function has several different time complexities ...
0
votes
1answer
61 views

Will publishing two or more public keys of the same RSA private key cause a security risk?

I want to make an end-to-end messaging platform where everyone is identified with a unique random private key. Everyone uses other peers' public keys to identify and send encrypted messages and verify ...
1
vote
2answers
468 views

Computational complexity of RSA

What's the computational complexity or RSA? One can assume it's O(prime length^2) it you consider multiplication by column, but speed tests slightly differ on slow operations with private key and ...
0
votes
2answers
870 views

How does RSA public and private key structure look like?

So I was reading this wiki about the RSA algorithm and I read this article to understand it better. My goal was to create a simple program that would generate private and public keys. I got to the ...
16
votes
2answers
11k views

Using the same RSA keypair to sign and encrypt

The RSA signature operation is basically the same as encrypting with the private key. In particular, both operations use the same kind of keys. Is it safe to use the same RSA keypair both for ...
5
votes
4answers
2k views

Choosing which is public vs private key

When I calculate two RSA keys, what if anything, would make any difference which I call the public vs which I call the private key?
1
vote
1answer
736 views

Main purpose for Carmichael's Function in RSA

I'm trying to understand the RSA cryptosystem, these are the steps: Generate two large different prime numbers $p$ and $q$. Calculate modulus $n$ ($n=pq$) Calculate: $λ(n) = \operatorname{lcm}(λ(p), ...
1
vote
1answer
61 views

Picking 'e' for RSA encryption

What is the reason behind picking either $3$ or $2^{16}+1$ for generating the public key in RSA?
4
votes
2answers
726 views

Is RSA inspired by Diffie Hellman?

I read a bit of A Method for Obtaining Digital Signatures and Public-Key Cryptosystems that introduced RSA in 1977, and, while learning the steps in RSA a few days ago, I noticed that they are similar ...
0
votes
0answers
9 views

Can modular operation used along with bit shif for cryptography? [closed]

Let a be input value, k1 and k2 be two keys. Then X=(a+k1) mod m; X=(x<<4); Y=x^k2; Can i decrypt back? Because i am not getting exact answer while ...
0
votes
1answer
46 views

Probabilistic padding to avoid Håstad’s Broadcast Attack

Can someone explain why probabilistic padding like OAEP is particularly useful for avoiding Håstad’s Broadcast Attack? I don't really get the reason why.
0
votes
0answers
18 views

PDP schemes parameter generation

For the PDP scheme, I need to generate the following parameter: g is a generator of Q (Q is the set of quadratic residues modulo N (N = pq is the RSA modulus) What algorithm can be used to generate ...
0
votes
0answers
6 views

Can we write both encrypted text and plain text to the same file? [migrated]

We have a requirement from customer to write payment transaction information to a text file. Of many lines of data per transaction, only one line contains cardholder information, which needs ...
14
votes
2answers
6k views

RSA with modulus product of many primes

I would like to ask what happens if we build an RSA system with modulus a product of more than 2 primes, for example let $n=p_{1}p_{2}...p_{L}$. I know only the classical RSA system with $n=pq$ with $...
0
votes
1answer
59 views

How to calculate e if we know n,p,q,m,c? [duplicate]

If we know n, p, q, and we have an encrypt oracle, which means we can input any plaintext and we'll get its ciphertext, and here p is smooth, which means the factors of p-1 are very small, is that ...
3
votes
1answer
114 views

Is OAEP needed when encrypting a session (random) key using RSA?

My question is two parts: when encrypting a session key which is used to encrypt bulk data using a block cipher for example, is padding with OAEP really needed [i'm assuming the key is generated ...
4
votes
3answers
532 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: ...
2
votes
1answer
83 views

man-in-the-middle attack on text-book RSA PKE

I am attempting to solve the following problem: I know the following: 3 messages are being sent between Alice and Bob, all messages are encrypted with the known public key $(d,N)$: Alice sends ...
1
vote
0answers
25 views

How to get the key data from the pkcs#8 format? [closed]

Being newbie to crypto, I understood that RSA keys are shared are pairs $(e,n)$ or $(d,n)$. But when I was given a doc with keys, they were in PKCS#8 format. How to get the keys out of this format?
15
votes
2answers
7k views

Which attacks are possible against raw/textbook RSA?

The PKCS#1 standard defines multiple padding schemes for signature generation/verification (EMSA-PSS and EMSA-PKCS1-v1_5), and encryption/decryption (EME-OAEP and the less safe EME-PKCS1-v1_5). ...
0
votes
1answer
35 views

How to prevent Public Key from being replaced entirely?

I am using RSA to sign my license file using Microsoft CNG API. I am signing the license file and sending the file with the <...
1
vote
2answers
530 views

Guidelines for cryptographic key generation

I was wondering whether you know can point me to some general (basic) principles/guidelines one should follow for generating cryptographic keys? I have looked at NIST 800-133, but was hoping for some ...
0
votes
1answer
26 views

I have created values for rsa encryption but it dosent always work [duplicate]

i am suing the values as follows: (p, q, n, phi(n), e, d) = (1033, 5039, 5205287, 5199216, 65537, 3784241) yes i have made sure e and phi(n) are coprime for example if i were to encrypt the value ...
0
votes
0answers
9 views

Get modulus of ssh-rsa public key? [migrated]

I'm trying to verify a JWT on client side with Auth0's library idtoken-verifier and am getting thrown an error when checking modulus and exponent of my public key (https://github.com/auth0/idtoken-...
1
vote
2answers
94 views

How do I calculate e, d and N based on raw and encrypted message in RSA?

I've got raw and encrypted message, which contains only numbers. For example: Message: 32016550980634121428089400169, encrypted: 35682226122303060179704449482 I'...
3
votes
1answer
64 views

Why is the strength of an Elliptic Curve Cryptography (ECC) half the size of the prime field size?

I've looked around and couldn't find a direct answer. As a general rule, I've read from various sources (here here, and here) that the strength of an elliptical curve key is half of the size of the ...
0
votes
0answers
28 views

Difference between JWE encryption algorithm RSAES-PKCS1-v1_5 and RSAES OAEP [duplicate]

In the specifications of JWE (RFC7516) they specify the values for (asymmetrically) encrypting the symmetric key. In RFC7518 in section 4.1 they list the options, of which two are relevant for my case ...
0
votes
1answer
57 views

How you find the unpadded short plaintext using RSA?

I am currently trying to understand how you find the unpadded short plaintext when you are using RSA. Please help with explaining the process and so I can understand this topic more.
-3
votes
0answers
66 views

finding private key for RSA

for RSA $N=pq$, $c = m^e \bmod N$ if $m^{12345}= 1 \bmod N$ is given, how to find RSA private key $d$ and message $m$. Note: $N,d,\phi$ are unknown. $e$ is publicly available. I think we can take $...
2
votes
1answer
283 views

How to choose the integer m in the general number field sieve (GNFS)?

Given an integer you want to factor $N$, GNFS starts by selecting a monic irreducible polynomial $f \in \mathbb{Z}[X]$ and an integer $m$ such that $f(m) \equiv 0 \text{ mod } N$. In practice, if $m$ ...
0
votes
1answer
376 views

Using One Time Pad and RSA compared to using only One-time Pad

Here I implemented One Time Pad first for only one time and then I used RSA algorithm to encrypt the message. For RSA algorithm, I pick p = 2143 and q = 3257 value which does not share any common ...
3
votes
2answers
1k views

How can a message encrypted with the public key be decrypted with the private key?

I've been reading about encryption and have a basic understanding of the concept. What I don't understand, however, is how a calculation with one key can result in a number that, through calculation ...
0
votes
0answers
17 views

is there any good implementation to the RSA in arduino ? c language [migrated]

I need a good implementation to the RSA algorithm that works on Arduino mega with key size 1024. the code will run on Arduino ide. the project idea simply is an android app send an encrypted message ...
12
votes
3answers
13k views

Is RSASSA-PKCS1-v1_5 a good signature scheme for new systems?

Is RSASSA-PKCS1-v1_5 a good signature scheme to recommend that people use in new systems? Is it believed to be secure and represent the state-of-the-art in RSA-based signatures? I understand that ...
1
vote
2answers
82 views

RSA padding: risk of using constants

Assume I want to make my RSA secure because I heard that textbook RSA, especially in conjunction with low exponents, is very risky. I decide to limit my message length to 100 and subsequently ...
4
votes
2answers
594 views

Using Lattice-based cryptography for TLS\SSL

Given the general benefits of Lattice-based cryptography, such as: Post quantum Security Security from worst case scenario Efficiency What could the outlook of shifting from RSA \ ECC-based ...
26
votes
3answers
300 views

Why does BitLocker not use RSA?

If understand correctly from this post and the Wikipedia page for BitLocker and TPM, by default, BitLocker uses symmetric cryptography like AES. However, TPM is capable of performing RSA encryption. ...
5
votes
3answers
259 views

Can Shor's algorithm factor multi-prime numbers?

I know that Shor's algorithm can factor semi-primes ($N = p \times q \space, \{p, \space q \in \Bbb{P} \space \vert \space p, \space q \gt 0 \} $). Assuming that all prime numbers are so large that ...
0
votes
1answer
71 views

RSA calculate public exponent

Suppose I have two messages $m_1$ and $m_2$ as well as $c_1$ and $n$. It's standard RSA so $c_1 = m_1^e \ mod \ n$, $c_2 = m_2^e \ mod \ n$. Further assume the only information we have about e is that ...
8
votes
1answer
508 views

The 9 lives of Bleichenbacher's CAT, it puts another scratch again

Bleichenbacher demonstrated a padding oracle attack against RSA implementations that follow the PKCS #1 v1.5. Through the years, there are various mitigation techniques developed as OAEP and limiting ...
2
votes
1answer
68 views

Discrete logarithm with exponentiation oracle

Suppose $(n, d)$ is an RSA private keypair. We know the public key only (wlog suppose it's $(n, 2^{16}+1)$ and we are given oracle $E$, decryption oracle for $(n, d)$. Is there any efficient algorithm ...