Questions tagged [public-key]

Public-key (or asymmetric) cryptography is a form of cryptography that does not require common secrets between the communicating partners.

Public-key cryptography or asymmetric cryptography is a form of cryptography that does not require common secrets between the communicating partners. It thus solves the problem of key-exchange. In many modern cryptosystems, public-key cryptography is used to establish a secret key, and the faster symmetric key crypto is used to actually encrypt and decrypt data.

Public-key cryptography is generally based on "one-way" mathematical functions - operations that are easy to perform, but difficult to undo. An example (on which RSA is based) is multiplication vs. factoring. Given two enormous primes p and q, it is simple (for a computer) to multiply them together to get p*q = n, but it turns out it is very difficult (even for a computer) to factor n in a reasonable amount of time.

1163 questions
13
votes
1 answer

SSH Permission denied (publickey) DigitalOcean Ubuntu

I can't seem to log in to my droplet on digitalocean. When I try ssh root@162.243.123.123 I get a Permission denied (publickey). I tried resetting the root password and logging in via the digitalocean droplet console, but it won't take the root…
Corey
  • 835
  • 1
  • 9
  • 32
13
votes
3 answers

Setup SFTP to use public-key authentication

How do you setup server to server SFTP to use public-key authentication instead of user account and password?
user290
13
votes
2 answers

Location of container for public and private keys in Windows?

I am trying to store my public and private keys in a container using following code: CspParameters cp = new CspParameters(); cp.KeyContainerName = "Test"; RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(cp); What I'd like to know is the…
Thabo
  • 1,492
  • 2
  • 18
  • 36
12
votes
2 answers

Manually create JWK from (RSA) PublicKey

I need to convert a RSA PublicKey into a valid JWK. Especially the values "n" an "e" of the JWK are the ones I'm struggling with. The encoding does not seem to be correct, when looking at example JWK's at…
KevKosDev
  • 811
  • 2
  • 9
  • 31
12
votes
1 answer

What exactly is a "key container"?

Is it something specific, with a definite structure, or just an arbitrary data file with some form of encryption to hold keys, and potentially other secret information? Can someone please explain the term or point me to a link.
saugata
  • 2,823
  • 1
  • 27
  • 39
12
votes
1 answer

Import .pem public and private keys to JKS keystore

I have public and private keys in separate .pem files that I would need to get into a JKS keystore somehow. Tried using the -import command in KeyTool for this, which gives an "not an X.509 certificate" error. I'm guessing the solution has to do…
Rolf
  • 2,178
  • 4
  • 18
  • 29
12
votes
2 answers

Generate Private and Public key OpenSSL

I have the following commands for OpenSSL to generate Private and Public keys: openssl genrsa –aes-128-cbc –out priv.pem –passout pass:[privateKeyPass] 2048 and openssl req –x509 –new –key priv.pem –passin pass:[privateKeyPass] -days 3650 –out…
kozla13
  • 1,854
  • 3
  • 23
  • 35
12
votes
3 answers

Why are "large prime numbers" used in RSA/encryption?

I've learned the theory of public key encryption but I'm missing the connection to the physical world. e.g. I've been told that good RSA encryption should rely on prime numbers with 300 decimal digits but why? who came up with this number? How long…
Yehonatan Ginzberg
  • 131
  • 1
  • 1
  • 6
11
votes
1 answer

InvalidKeyException: Invalid key format java

I am trying to retrieve the public key from Vault. It is stored as secret. I am trying to convert the string retrieved to a PUBLIC KEY to verify the signature. Sample public key string looks like this -----BEGIN PUBLIC KEY-----…
Rohi
  • 385
  • 2
  • 3
  • 15
11
votes
4 answers

Deriving an ECDSA uncompressed public key from a compressed one

I am currently trying to derive a Bitcoin uncompressed ECDSA public key from a compressed one. According to this link on the Bitcoin wiki, it is possible to do so... But how? To give you more details: as of now I have compressed keys (33-bytes-long)…
Clara-sininen
  • 191
  • 2
  • 9
11
votes
2 answers

Cannot find id_rsa.pub in the unix server. Can I regenerate it? Id_sra (private key) exists

What I want to do is to copy key to another host. ssh-copy-id -i ~/.ssh/id_rsa user@host I get error: /usr/bin/ssh-copy-id: ERROR: failed to open ID file '[homedir].ssh/id_rsa.pub': So there is no public key. So where is it? I tried to use command …
Dariux
  • 3,953
  • 9
  • 43
  • 69
11
votes
1 answer

Can I get ssh public key from url in bitbucket?

github provide public ssh key by URL like http://github.com/user.keys. Is there a way also in bitbucket to obtain public keys via URL?
ironsand
  • 14,329
  • 17
  • 83
  • 176
11
votes
3 answers

Simple DER Cert Parsing in python

Which is the best way to parse with python a binary file with X509 Certificate in DER format to extract public key.
David A
  • 763
  • 1
  • 9
  • 22
11
votes
5 answers

Generating REALLY big primes

I'm playing around and trying to write an implementation of RSA. The problem is that I'm stuck on generating the massive prime numbers that are involved in generating a key pair. Could someone point me to a fast way to generate huge primes/probable…
nonpolynomial237
  • 2,109
  • 4
  • 27
  • 35
10
votes
7 answers

How to access COWIN APIs?

I want to access these APIs from cowin.gov.in This API is for getting the vaccination certificate - https://ndh.digitallocker.gov.in/public/marketplace/api/cowin/cowincert But when I access this using mobile number and a beneficiary ID , I get…
anirudh
  • 1,436
  • 5
  • 18