Questions tagged [private-key]

Private key that occurs in asymmetric cryptography algorithms such as RSA and Diffie-Hellman as the counterpart to a public key. The private key must never be divulged while the public key can be made available to everyone. If your question is not pertaining specifically to the private key (usage/encoding/etc.), you should use more appropriate tags such as [public-key-encryption], [digital-signature], [diffie-hellman] or even [cryptography].

1626 questions
7
votes
1 answer

C code to clean up memory for openssl EVP_PKEY private keys

I'm starting learn OpenSSL programming in C/C++. An issue I encountered is, how could I safely wipe out the memory for private keys? For example, I may have code: EVP_PKEY *private_key = PEM_read_bio_PrivateKey( bio, ,,,) RSA *r = EVP_PKEY_get1_RSA(…
pokeba
  • 81
  • 1
  • 5
7
votes
1 answer

Why KeyPair.getPrivate().getEncoded() is null?

public KeyPair generateKeyPair(@NonNull Context context, @NonNull String alias) { Calendar startDate = Calendar.getInstance(); Calendar endDate = Calendar.getInstance(); endDate.add(Calendar.YEAR, 1); KeyPairGenerator…
Fang
  • 3,652
  • 4
  • 16
  • 30
7
votes
2 answers

Decrypt with PrivateKey X.509 Certificate

I have a problem to decrypt a message usgin X.509 Certificate. I generate my certificate with makecert with this options: makecert -r -pe -n "CN=MyCertificate" -ss CA -sr CurrentUser -a sha1 -sky signature -cy authority -sv CA.pvk CA.cer And the…
jomarmen
  • 97
  • 1
  • 2
  • 8
7
votes
1 answer

Generate Private Key from Pem String Golang

I am trying to generate private and public key objects in Golang from PEM strings heres my example r := strings.NewReader(privateKey) pemBytes, err := ioutil.ReadAll(r) if err != nil { log.Fatal(err) } block, _ :=…
Khalil Claybon
  • 143
  • 1
  • 8
7
votes
1 answer

What's the use of the Public and Private key for reCAPTCHA?

reCAPTCHA requires a public and a private key before it can be implemented into a website. It also needs the reCAPTCHA keys depending on the website. What's the reason behind this? Does the Public and Private key affect the words displayed in the…
Registered User
  • 8,706
  • 9
  • 32
  • 40
7
votes
2 answers

Objective C: Exporting Private and Public Key from Keychain

I am able to create a public-private keypair using SecKeyGeneratePair [Apple CryptoExercise]function. Q1. The keys in the keychain appear as without displaying any name. How can we add a friendly name to the keys. Q2. However how can i export…
ZestyZest
  • 911
  • 13
  • 27
7
votes
6 answers

Confused about encryption with public and private keys (which to use for encryption)

I am making a licensing system when clients ask my server for a license and I send them a license if they are permitted to have one. On my current system I encrypt the license using a single private key and have the public key embedded into the…
jax
  • 37,735
  • 57
  • 182
  • 278
7
votes
2 answers

How to use encrypted RSA private key with PyCrypto?

I am generating a key with OpenSSL, providing the password from stdin: openssl genpkey -algorithm RSA -out private-key.pem -outform PEM -pass stdin -des3 -pkeyopt rsa_keygen_bits:4096 The key then looks like: -----BEGIN ENCRYPTED PRIVATE…
stf
  • 591
  • 1
  • 4
  • 19
7
votes
3 answers

How to read a private key from pvk file in C#?

I have to read a private key, and this key is on pvk format. I use X509Certificate2 class, but i this class i have only public key access. How can I get a private key from pvk file?
Luiz Costa
  • 1,515
  • 2
  • 12
  • 12
7
votes
2 answers

Extract multiple keys from one .p12 file using OpenSSL ruby

I am wondering how to extract keys from an Apple .p12 file. From my limited understanding, a .p12 file is a combination of X504 certificates and private keys. I am seeing that every .p12 file I run into has a X504 certificate and at least one key,…
Anthony To
  • 2,193
  • 2
  • 21
  • 29
7
votes
2 answers

Read a Private Encrypted Key in Java

I have the following piece of code: PEMParser pemParser; File telexuskeys = new File(locationKey); if(telexuskeys.exists()) pemParser = new PEMParser(new FileReader(telexuskeys)); else{ usage(ops); throw new…
7
votes
3 answers

PrivateKey trust permissions for local machine "Trusted roots" certificates

I have a certificate that has to be imported into Certificates/Trusted Root Certification Authorities and has a corresponding private key. To actually access the key from code you need to set private key permissions to grant full access to…
Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
6
votes
4 answers

Encrypting a BouncyCastle RSA Key Pair and storing in a SQL2008 database

I have a function that generates a BouncyCastle RSA key pair. I need to encrypt the private key and then store the encrypted private and public keys into separate SQL2008 database fields. I am using the following to get the keypair: private static…
TravisPUK
  • 1,043
  • 1
  • 14
  • 17
6
votes
1 answer

Why does PuTTY use its own private key format when log into SSH server?

Just a little bit curious, why PuTTY use its own version of private key format to do SSH?
user705414
  • 20,472
  • 39
  • 112
  • 155
6
votes
3 answers

How do I load my Solana wallet using my private key file?

I'm attempting to use the private key I generated using the Solana command-line to create a wallet in JavaScript / Node. I want to use the web3.Keypair.fromSeed() method. Here are the steps I've take so far. created a solana wallet : solana-keygen…
raddevus
  • 8,142
  • 7
  • 66
  • 87