Questions tagged [public-key-encryption]

An cryptographic scheme which uses two mathematically related keys; a public and a private key where a message encrypted with public key can only be decrypted with the private key and vice-versa.

The most important element of public key encryption is that the public and private keys are related in such a way that only the public key can be used to encrypt a message and only the matching private key can be used to decrypt it. In addition, it is practically impossible to derive the private key with only the knowledge of the public key. Public-key systems such as PGP, SSL and many others benefit from this mathematically well-defined behavior of public key encryption. It is important to note that public key encryption is mostly called asymmetric encryption because it uses two keys instead of one key as opposed to symmetric encryption.

1918 questions
7
votes
2 answers

Encryption and decryption error 0x0407106B using OpenSSL

I'm writing a routine in C that reads a base64 string with the public key and proceeds to encrypt a string. I also test the same string's decryption but I'm getting error 0x0407106B when trying to do the decoding: $ openssl errstr…
xain
  • 13,159
  • 17
  • 75
  • 119
7
votes
1 answer

How to import PKCS#12 into Seahorse

I have a PKCS#12 file which I have successfully imported into Firefox. Now, I would like to import the same file into Linux in order to use public-Key cryptography with these keys. I have tried to import it using Seahorse, but it failed. Maybe…
srus
  • 319
  • 2
  • 8
7
votes
1 answer

How to store and retrieve an RSA public key in Android keystore which is generated from server side application?

The server side application generate an RSA key pair,and as a part of key exchange process i get this public key from server and now i want to store this key inside android KeyStore. I have seen examples with generating rsa key pair using…
Raneez Ahmed
  • 3,808
  • 3
  • 35
  • 58
7
votes
5 answers

Java ssh-rsa string to public key

I want to get the public key of the content of an .pub file. This is an example what the content of a .pub file looks like(generated with ssh-keygen): ssh-rsa…
Jan Wytze
  • 3,307
  • 5
  • 31
  • 51
7
votes
2 answers

How to generate a Curve25519 key pair in Terminal?

How can we generate a Curve25519 key pair from the command line? We have a MacBook Air with Homebrew installed. Should we use OpenSSL or another command line tool? How do we use that tool to generate a Curve25519 key pair?
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
7
votes
4 answers

How to send and receive encrypted email using PHP

I work at a hospital and have developed a way to estimate the total patient financial responsibility for services, after insurance has paid it's obligation, and before any services are rendered. A lot of patients are calling for quotes, and I wanted…
user390955
  • 71
  • 1
  • 2
7
votes
1 answer

How do I verify a JSON Web Token using a Public RSA key?

New question to keep this question specific and to the point. I have a JWT from Azure and now I need verify the signature in my application. The public keys from Microsoft can be found here: https://login.windows.net/common/discovery/keys How do I…
Knightsbridge
  • 511
  • 5
  • 13
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
1 answer

Generate RSA Public Key from Modulus and Exponent

I'm looking to generate a rsa public key (pem) from both the modulus and exponent in Objective-C. This function can be done in Java by the following; PublicKey publicKey = KeyFactory.getInstance("RSA").generatePublic(new RSAPublicKeySpec(modulus,…
Harry
  • 3,301
  • 7
  • 27
  • 33
7
votes
2 answers

How to use apache vfs2 for sftp with public-private-key and without password

Currently I am using apache vfs2 to download files from a sftp. For authentication I use user-name and password. Is there a way to use vfs2 only with public-private-keys and without a password? I think I have use this function,but how? Set it only…
LStrike
  • 1,598
  • 4
  • 26
  • 58
7
votes
4 answers

How does two-way asymmetric encryption work?

Say we have Alice and Bob. Alice sends Bob a message she encrypted with Bob's public key. Bob is the only person who can decrypt it, using his private key. But how can he be certain the message came from Alice? Suppose he replies, encrypting…
user47589
7
votes
1 answer

Simple RMI Server with SSL

Trying to setup a simple RMI server with SSL encryption. It's for a simple chat application that has a java server app and a java client app, however, I can't even get it working with a simple RMI example at the moment! The only way I can get it to…
Dave Clarke
  • 2,677
  • 4
  • 22
  • 35
7
votes
1 answer

I understand the mathematics of RSA encryption: How are the files in ~/.ssh related to the theory?

I went through the math in the "worked example" in the RSA wiki page: https://en.wikipedia.org/wiki/RSA_(algorithm) and understood it entirely. For the remainder of this question, I will use math variables consistent with the wiki page. I'm on a…
User314159
  • 7,733
  • 9
  • 39
  • 63
7
votes
2 answers

Create .pem file for public key RSA encryption C# .net

I want to create .pem file for the public key generated by this method public static Tuple CreateKeyPair() { CspParameters cspParams = new CspParameters { ProviderType = 1 /* PROV_RSA_FULL */ }; …