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
14
votes
3 answers

How can I encrypt with a RSA private key in python?

Is it possible to encrypt a message with a private key in python using pycryptodome or any other library? I know that you are not supposed to encrypt with the private key and decrypt with the public key, but my purpose is to encrypt with the private…
14
votes
6 answers

sshtunnel doesn't recognize private key password

I'm using sshtunnel to connect to connect to a remote server and on to a database from there. Everything is working fine, except that sshtunnel doesn't seem to recognize my ssh_private_key_password unless I've already entered it elsewhere (or more…
user3092118
  • 351
  • 1
  • 3
  • 10
14
votes
3 answers

Android Decryption Error

I am trying to encrypt and decrypt Strings in my Android application but I keep getting an InvalidKeyException error. Here is my code: //Generate Keys method public void generateKeys() { Calendar cal = Calendar.getInstance(); Date now =…
Donal Rafferty
  • 19,707
  • 39
  • 114
  • 191
14
votes
3 answers

How can I know if a .pem file contains public or private key?

I have a .pem file (base64-encoded cryptography information). What OpenSSL command-line should I use to detect whether it contains a public key or a private key? As explained in this StackOverflow question, a .pem can contain both. Since the…
Suzanne Soy
  • 3,027
  • 6
  • 38
  • 56
14
votes
4 answers

TeamCity Git VCS SSH connection with Custom Private Key throws JschException: Auth fail

I can't seem to get TeamCity to read my Git (Gitolite) repository... I get an exception: List remote refs failed: com.jcraft.jsch.JSchException: Auth fail What I've tried: (I use PuTTY to export them to OpenSSH format) Use personal working(!!)…
baskabas
  • 333
  • 3
  • 5
  • 15
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
1 answer

keytool -list shows different aliases for p12 keystore, depending on whether you provide the password

Really weird behaviour on a particular p12 file. If I run keytool -list -storetype pkcs12 -keystore my_debug_keystore.p12 -storepass debug keytool -v -list -storetype pkcs12 -keystore my_debug_keystore.p12 -storepass debug I get, Alias name:…
seaders
  • 3,878
  • 3
  • 40
  • 64
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
1 answer

ssh2_auth_pubkey_file authentication always fails

I'm trying to connect to another machine using PHP's ssh2 functions. I know the ssh keys have been created with no passwords and are distributed correctly, I can ssh user@host in the terminal on my machine to the server. The PHP function tries to…
James Kirkby
  • 1,716
  • 5
  • 24
  • 46
12
votes
5 answers

GitLab SSH keys stopped working

OK, I've stumbled on this topic many times, but this is the first time that none of the regular solutions worked. I have a CentOS 6.4 server running GitLab. It's been working great with 20+ users and 60+ projects, but about 5 hours ago, my main…
SlipY
  • 199
  • 1
  • 2
  • 10
12
votes
3 answers

Load private key manually with ssh

Is it possible to run ssh with ignoring default .ssh directory and specify other one or - better - specified private key ? For example: ssh --private-key other_id_rsa login@host
hsz
  • 148,279
  • 62
  • 259
  • 315
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
6 answers

openssl_pkey_new() throwing errors -- Proper openssl.cnf setup for php

**Okay, It's become clear that this issue is an issue related with the setup of openssl on the Linux server and how to properly setup a custom openssl.cnf file. I am not looking for anything complicated but I need a front-end to be able to create…
Codeguy007
  • 891
  • 1
  • 12
  • 32
12
votes
2 answers

SSH keys in environment variables

So I'm setting up a really awesome hubot setup which will automatically deploy code from github to heroku, via a free heroku nodejs app. I'm having trouble checking out the repo properly on AWS. I created SSH keys on the remote box, had them working…
RandallB
  • 5,415
  • 6
  • 34
  • 47