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
7
votes
2 answers

JSch SFTP security with session.setConfig("StrictHostKeyChecking", "no");

I use JSch with private key to FTP file jsch.addIdentity(privatekeyfile); Session session = jsch.getSession( "user", "domain.com" ,22); session.setConfig("StrictHostKeyChecking", "no"); Line 3 is in question. Without this line, JSch does not…
Tony
  • 603
  • 5
  • 9
  • 17
7
votes
2 answers

C# LINQ counting elements with DISTINCT

I have a collection of KeyValuePair items with DateTime as key and a string as value. Basically my data looks like: 12/07/2013 - 10220 12/07/2013 - 10220 12/07/2013 - 12220 12/07/2013 - 11240 12/07/2013 - 15220 13/07/2013 - 23220 13/07/2013 -…
Ras
  • 628
  • 1
  • 11
  • 29
6
votes
1 answer

Node.js: How to convert RSA public key to OpenSSH format?

I am on node version: v10.14.1 and I generate keyPairs with this code: generateKeyPair('rsa', { modulusLength: 4096, publicKeyEncoding: { type: 'pkcs1', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', …
Jodo
  • 4,515
  • 6
  • 38
  • 50
6
votes
1 answer

C++ openssl - Generate RSA Keypair and read

I am trying to generate RSA keypair using openssl library and then read the same keys later. However, it fails. Sometimes it gives me this error: error:0906D06C:PEM routines:PEM_read_bio:no start line And sometimes, it gives me…
sburnwal
  • 145
  • 1
  • 6
  • 10
6
votes
1 answer

Generate a RSA Private/Public Key pair for SSH login on Android

I am working on a project where I need my app to generate a public/private RSA key for SSH login. I have the following code so far to get the keys: private void createKeyTest() { try { KeyPairGenerator kpg =…
Boardy
  • 35,417
  • 104
  • 256
  • 447
5
votes
0 answers

Android keystore2.AndroidKeyStoreProvider throws NPE on Samsung devices with API 31

I'm getting lots of crash reported on samsung devices running android 12 from yesterday. AndroidKeyStoreProvider throws NPE when calling X509Certificate.getPublicKey(). it's working fine on other brands devices. Key pair generation method : …
5
votes
2 answers

AWS CodeBuild with Github Enterprise Deploy Keys asking for passphrase

I'm trying to use Deploy Keys for my Github Enterprise repo so that I can push newly deployed tags using a CodeBuild project. I cannot get it to work, no matter what I try. In my local machine: (MacOS) I am generating the keys using a command like…
Tyler
  • 398
  • 1
  • 11
5
votes
1 answer

why can i not connect to ssh reverse tunnel?

I'm using autossh -M 20000 -fN -R 19999:localhost:22 -i mycert.pem ubuntu@myaws.hopto.org to establish a reverse tunnel to my aws machine. Now, when I try to access the machine from aws, I got the following: $ ssh ron@localhost -P 19999 Permission…
stdcerr
  • 13,725
  • 25
  • 71
  • 128
5
votes
1 answer

Generate public and private key using a string

In Java I would like to generate a public and private key based on a string in my app. I'm not going for security, I'm going for "Can I generate the same public and private key using this string". How would I do that? I was looking at these…
CQM
  • 42,592
  • 75
  • 224
  • 366
5
votes
2 answers

Rsync to Amazon Linux EC2 instance - Permission deniend

Just for running a test I want to put an image file into one of my instance folders from my Desktop. I've tried solutions provided at this same topic question: Rsync to Amazon Ec2 Instance So I've tried: sudo rsync -azv --progress -e "ssh -i…
kuro42
  • 177
  • 3
  • 8
4
votes
2 answers

Create a key pair and download the .pem file with Terraform (AWS)

I could create the key pair myKey to AWS with Terraform. resource "tls_private_key" "pk" { algorithm = "RSA" rsa_bits = 4096 } resource "aws_key_pair" "kp" { key_name = "myKey" # Create a "myKey" to AWS!! public_key =…
4
votes
1 answer

How can I create development and production Cloudfront key pairs?

I'm working on a system that uses Amazon S3 to store sensitive user media, which users access via a Cloudfront distribution. I'm locking down public access using Cloudfront's query parameter authentication so that we create a secure string using a…
dwat
  • 312
  • 2
  • 6
  • 14
4
votes
1 answer

How to convert RSA public key to string using BouncyCastle c#

I'm trying to save RsaKeyParameter Public Key into an SQL database. I get an error that Bouncy Castle can't convert RsaKeyParameters to bytes. Using BouncyCastle c#. I've generate an RSA key pair, extracted the private and public keys into…
MarkC
  • 43
  • 1
  • 4
4
votes
3 answers

How to create aws ec2 private-public key pair

I'm following this guide of creating aws environment. Now after I created my environment I want to ssh to the ec2. What I need is to create private-public key pair, which I don't know how. at the beginning of the guide, it tells: Generate public key…
Yagel
  • 1,184
  • 2
  • 18
  • 41
4
votes
1 answer

KeyPairGenerator.generateKeyPair() in Android 7.1.1

We have seen an influx of the following exceptions and only for Android 7.1.1 (API 25). Has something changed in 7.1.1 to make this fail? java.security.ProviderException: Failed to load generated key pair from keystore at…
fobbymaster
  • 1,406
  • 3
  • 14
  • 22
1
2
3
19 20