# Questions tagged [public-key]

An asymmetric cipher is an encryption scheme using a pair of keys, one to encrypt and a second to decrypt a message. This way the encrypting key need not be kept secret to ensure a private communication. Similarly in public key authentication, the verification key can be public and the signing key private.

1,878 questions
Filter by
Sorted by
Tagged with
1answer
1k views

### How is the session key more secure than the public key?

From the website of GNU Privacy Guard (GnuPG): If an attacker could decrypt a session key it would only be useful for reading the one message encrypted with that session key. The attacker would have ...
1answer
108 views

### Decrypting message as MSB in regev scheme

I was watching this FHE video and it define Regev encryption scheme as fallow : kyegen: sk : choose $t = (1,s)^t \in \mathbb{Z}_q^{n+1}$ pk = $A \in \mathbb{Z}_q^{m*(n+1)}$ random except $[A * t]_q$ ...
1answer
157 views

### The security level of double encryption

Let PKE $\Pi' = (Gen', Enc', Dec')$ and it is secure in the sense of $S'$. Let PKE $\Pi'' = (Gen'', Enc'', Dec'')$ and it is secure in the sense of $S''$. $S'$ and $S''$ may be separation which means ...
1answer
9k views

### What is a trapdoor permutation?

Can anyone explain to me what a trapdoor one-way permutation is? Is RSA a trapdoor one-way permutation? Context: I was reading about ring signatures. On page 560, it describes steps to implementing ...
1answer
99 views

### Is it possible to multiplex TLS connections by SNI metadata without knowing any keys?

Imagine the following communication diagram: C1-----\ /--B1 C2------P---B2 ...----/ \--... We have multiple C(lients), call them C1, C2, etc. They connect to a ...
0answers
42 views

### Why is a hash function required for building Public Key Encryption from a Trap Door Function

This is from Dan Boneh's Coursera Lectures - Week 6 - Constructions. https://www.coursera.org/learn/crypto/lecture/nTRhL/constructions Here he picks a random x from X. And then Hashes X to get the ...
1answer
72 views

### Making a secure file sharing scheme usable

I am trying to realize a secure file sharing scheme based on asymmetric crypto. Users will access this via browser. In short, it works like this: Users register and set their username and password. ...
0answers
39 views

### Recommended length for a nonce in hashed-based authentication

Considering the following variation of the SKID3 protocol (1) $A \rightarrow B: r_A$ (2) $B \rightarrow A: r_B || \operatorname{MAC}(r_B||r_A||A)$ (3) $A \rightarrow B: \operatorname{MAC}(r_B||r_A||B)$...
0answers
51 views

### Deterministic generation of secure private keys from parent private key

is it possible to generate set of child private keys from one parent private key, generated by ECC for example, securely? So that new private key (and derive public key) could be used for encryption ...
3answers
21k views

### Why are RSA ciphertexts different for the same plaintext?

I am using SpongyCastle for a project on android. I have used RSA to encrypt the data and then decrypt it in another activity, the keys are stored in the shared preferences. I discovered a thing I ...
0answers
35 views

### How GGH/HNF public key cryptosystem encryption process works

I'm reading paper Lattice based cryptography which at section 5 page 14 it describes GGH\HNF scheme that i can not quite get it and i need help. The private key is a “good” lattice basis $B$. ...
0answers
31 views

### Is there a secure way of allowing users of my app to selectively share data from an external service?

Is there a secure way of allowing users of my app to selectively share data from an external service with my app? In order for the users of my app to get their personal data from the external service ...
4answers
4k views

### Why should the RSA private exponent have the same size as the modulus?

Consider the generation of an RSA key pair with a given modulus size $n$ and a known, small public exponent $e$ (typically $e = 3$ or $e = 65537$). A common method is to generate two random primes ...
1answer
11k views

### How can one validate with a public key a JWT signature generated with a private key?

As I understand it, a JSON Web Token (JWT) consists of 3 parts: the header, specifying the hashing algorithm to use for the signature; the payload itself; and the signature, which is a hash of the ...
5answers
18k views

### Does RSA work for any message M?

I decided to read the original RSA paper A Method for Obtaining Digital Signatures and Public-Key Cryptosystem because of a question I had about RSA (which is not the question I'm about to ask, but ...
2answers
179 views

### What is the need for Diffie-Hellman key exchange when we have asymmetric encryption?

I am new to cryptography and I am having a hard time to understand what is the need for DHKE procedure. I think I fully understand the principle in which it happens and also the mathematics behind it ...
1answer
121 views

### Encode ASN.1 PKCS#8 Private Key with Public Key and attributes

I'm trying to encode an Ed25519 private key as a PEM file based on this document https://tools.ietf.org/html/rfc8410#page-7 . I'm using an ASN.1 encoder written in Dart, and I can encode the private ...
2answers
2k views

### More than one private key for RSA

In an RSA-encryption scenario, Bob's public key pair $(n, e)$ is $(143, 43)$. An attacker Mallory tries brute-force and comes to $d = 7$ as the private key. The value of $φ(143) = 120$ is not known to ...
1answer
1k views

### What use is the signature without the message under RSA?

Using RSA for signing & verification, is there a way to take a valid signature for an unknown message, and for someone else to generate a valid signature using a different key against the valid ...
1answer
10k views

### Why ssh-gen makes difference between PEM and PKCS8?

Correct me if I am wrong, but PKCS8 is format to store private key info. It could be binary-enoded (DER) or Base64 encoded (<...
1answer
330 views

### Finding MSB in RSA

Scenario: Alice and Bob send each other encrypted AES (128) messages. In order to change key, Alice has a public RSA key (2049 bits). Bob has Alice's public key. Bob picks a random AES key, encrypts ...
0answers
83 views

### Is inverse polynomial in a finite field NP hard?

In ECC we have: if we know $G$ and $P=kG$, it is very difficult to find $k$. I wonder whether or not in NTRUEncrypt: if we know $h$ and $P=rh$, it is difficult to find $r$?
2answers
4k views

### How do I get the equivalent strength of an ECC key?

I know how to calculate the comparable symmetric strength of an RSA modulus: calculate the running time for a field sieve. This is how NIST gives approximate symmetric sizes for asymmetric algos in ...
1answer
104 views

1answer
80 views

### Why in RSA do we use mod n rather than mod phi(p⋅q)?

When we pick $e$: $$e \in \{1,2,3,4,...,\phi(p\cdot q)-1\}$$ where $\gcd(e,\phi(p\cdot q))=1$. Similarly when computing $d$ which is the modular inverse of $e$ (the private key) we use the extended ...
4answers
1k views

### Using public key cryptography with multiple recipients

I have a message that I want to send to multiple recipients. Can I encrypt the message separately with each of the recipient's public keys, then send the message thus encrypted to the respective ...
0answers
33 views

### R, S, and Z values in a transaction using the Transaction ID

How can i get the R, S, and Z values and the Public Key using a transaction IDE i have? I knew of a website called 2coin.org which provided these values but now the website is no more active and it ...
0answers
46 views

### How can JWE support an integrity check given that it uses a public key to encrypt the message?

As far as I know JWE (JSON Web Encryption) supports both integrity and confidentiality. I agree about the confedintiality because only the recepient with a private key can decrypt a message. What ...
2answers
2k views

### Why is this not a viable key exchange algorithm? [duplicate]

I was just wondering why this kind of algorithm can't be used instead of, say, Diffie-Hellman to exchange keys: Alice decides on a key she wishes to share with Bob. Alice generates a stream of bytes ...
1answer
4k views

### Why do we encrypt-then mac but sign-then-encrypt?

This question was asked in comments on my answer to should we sign then encrypt or encrypt then sign. I think posing the question as a separate entity is best, so: The general advice for applying ...
1answer
71 views

### What would be the most recommended AES && RSA Keys for production?

While I am a front-end developer and not a security expert programmer, I am worry about the keys I am using for my AES && RSA encryption. Please help me to understand: Is the following keys ...
1answer
552 views

### XOR instead of Multiplication in ElGamal encryption

In the ElGamal encryption scheme, the message $m$ is multiplied with the secret $g^{xy}$ Wikipedia. I don't understand the advantage of it. Why we can't just XOR our message with the shared secret? As ...
2answers
91 views

### Can the ECDSA still work without present of hashing function? [duplicate]

According to walkthrough steps for ECDSA topic from wikipedia as shown below, What if the impact if we don't apply the hashing function (highlighted in blue in the image) to the raw messages? Although ...
2answers
87 views

### Using different hashing function with ECDSA

I came across an IC device configuration & security flow and the details are illustrated in image below. I'm wondering must the ECDSA pair with the SHA Hashing function? Alternatively, what if ...