Questions tagged [key-pair]

Public-key cryptography, or asymmetric cryptography, is any cryptographic system that uses pairs of keys: public keys that may be disseminated widely paired with private keys which are known only to the owner.

Public-key cryptography, or asymmetric cryptography, is any cryptographic system that uses pairs of keys: public keys that may be disseminated widely paired with private keys which are known only to the owner. There are two functions that can be achieved: using a public key to authenticate that a message originated with a holder of the paired private key; or encrypting a message with a public key to ensure that only the holder of the paired private key can decrypt it.

In a public-key encryption system, any person can encrypt a message using the public key of the receiver, but such a message can be decrypted only with the receiver's private key. For this to work it must be computationally easy for a user to generate a public and private key-pair to be used for encryption and decryption. The strength of a public-key cryptography system relies on the degree of difficulty (computational impracticality) for a properly generated private key to be determined from its corresponding public key. Security then depends only on keeping the private key private, and the public key may be published without compromising security.


Source: Wikipedia

287 questions
2
votes
1 answer

TweetNaCl.js Public-key signatures example err

I want to use ed25519 to sign my message. And I found TweetNaCl.js which has the Signatures method to achieve my goal. By referencing TweetNaCl.js minimal Public-key signatures example and official document-Signatures, here is my test code…
Dana Chen
  • 216
  • 3
  • 14
2
votes
4 answers

How to manage EC2 key pairs for multiple users?

I'm working in a team with 8 people. I need to create an EC2 intance. Just before I create the instance, EC2 lets me create a key-pair and then download it. The problem is: That way I need to share the same private key for all 8 team members. Now,…
Alon
  • 10,381
  • 23
  • 88
  • 152
2
votes
1 answer

Why aren't large RSA keys encrypting to a unique value?

I'm calculating two 2048-bit prime numbers using BigInteger's probablePrime method, as follows: BigInteger.probablePrime(2048, new Random());. Respectively, let's call those primes p and q. I'm calculating the private exponent, using the following…
broment
  • 76
  • 6
2
votes
3 answers

How to Get Private Key from Certificate in an Azure Key Vault?

I have a Certificate in an Azure Key Vault that I would like to extract a private key from. According to the Microsoft Docs: When a Key Vault certificate is created, an addressable key and secret are also created with the same name. The Key Vault…
AlanPear
  • 737
  • 1
  • 11
  • 32
2
votes
1 answer

Swift 3/4 - Generate SecCertificate from Elliptic Curve Keypair

Currently i am generating an Elliptic Curve KeyPair in my iOS App successfully: let privateKeyParams: [String: Any] = [ kSecAttrIsPermanent as String: true, kSecAttrApplicationTag as String: privateTag ] let publicKeyParams: [String: Any] =…
Creative crypter
  • 1,348
  • 6
  • 30
  • 67
2
votes
3 answers

Separating public and private keys of ECDSA keypair

I'm using c++ to try to generate a ECDSA key-pair following Elliptic_Curve_Cryptography from the OpenSSL wiki. #include #include #include int main() { EC_KEY *key; if(NULL == (key =…
Todde
  • 160
  • 1
  • 10
2
votes
1 answer

How do I do encryption/decryption without generating keypairs again?

I have been working on a project myself and using this website's codes as a guide. Is there any way, I can put the generation of keys into 1 file and encryption/decryption into another. How do I define bob_box without having to generate another pair…
meh
  • 53
  • 1
  • 7
2
votes
5 answers

kSecAttrKeyTypeEC causing encryptMessageWithPublicKey() to fail

I'm trying to get sha384 with ECDSA keys. I'm following this article but I changed RSA to EC, of course. The keys are successfully generated, but encryptMessageWithPublicKey() doesn't work :( Variable "status" in method…
adek_dev
  • 49
  • 1
  • 8
2
votes
0 answers

Javacard error when trying to create RSA 2048 key pair

I'm developing a piece of code in which I need to create an RSA key pair. My java card is an FM1280-ID006 card which has written in its information sheet that It supports java card 2.2.2 specification. When I try to create an RSA key…
MJay
  • 987
  • 1
  • 13
  • 36
2
votes
0 answers

Android Keys in AndroidKeyStore without encryption

It is possible to store key pairs unencrypted by omitting KeyPairGeneratorSpec.setEncryptionRequired(). In this case, the key pair is presumably stored in clear, rather than encrypted with a key derived from the device lock screen credentials. It is…
user1118764
  • 9,255
  • 18
  • 61
  • 113
2
votes
1 answer

RSA KeyPairGenerator with BouncyCastleProvider e*d(φ(n)) not equal to one

I used BouncyCastleProvider(version is 1.54) to generate RSA keypair, and I want to test if the key is valid. According to wikipedia the RSA algorithm key as below: Choose two distinct prime numbers p and q Compute n = pq Compute φ(n) = φ(p)φ(q) =…
Jswq
  • 758
  • 1
  • 7
  • 23
2
votes
2 answers

Generate KeyPair with RandomSecure

Is there anyway I can generate always the same private key? I tired to initialize KeyPairGenerator with a RandomSecure object which uses the same seed: private PrivateKey getPrivateKey(String seed) { try { SecureRandom sr = new…
Leem.fin
  • 40,781
  • 83
  • 202
  • 354
2
votes
1 answer

OpenStack: permission denied (publickey) when SSH'ing to the VMs

I am running devstack and I have created two instances with two different keypairs. This is my image: +------------------+--------------------------------------+ | Property | Value …
2
votes
0 answers

Generating keypair and storing in Keystore

I'm currently working on a system based on this article: http://www.codeproject.com/Articles/4940/Using-XML-Digital-Signatures-for-Application-Licen However, in the article he uses sn.exe to generate a keypair and store it into a key container. I'm…
Ben
  • 1,291
  • 2
  • 15
  • 36
2
votes
1 answer

Java 7 ECC keypair generation with keytool

Correct me if i am going wrong somewhere as i am new to crypto field. I am using following commands to generate EC keypair in Java 7: As per : docs.oracle.com/javase/7/docs/technotes/tools/windows/keytool.html#Commands keytool -genkeypair -alias…
user3215268
  • 21
  • 1
  • 4