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

PHP OpenSSL Public Key Encryption With String Public Key

I have a public key -----BEGIN PUBLIC…
geoffreak
  • 2,288
  • 3
  • 17
  • 18
7
votes
2 answers

Please Help-Stuck Invalid Key Exception

I am getting java.security.InvalidKeyException: Illegal key size or default parameters , I have fallow all the required step ,Installed Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. Also I have Gone through these…
Raghvendra
  • 383
  • 1
  • 4
  • 11
7
votes
1 answer

Encryption with certificate

I'm quite new to all this encryption thing and I'm trying to do a simple app to encrypt a given string. Here's my code: public static X509Certificate2 getPublicKey() { RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); …
antistes
  • 71
  • 1
  • 1
  • 3
7
votes
2 answers

How can I fill in RSAParameters value in c#

I was using below code for encryption in my project and everything was working fine. RSACryptoServiceProvider x_alg = new RSACryptoServiceProvider( ); // export only the public key RSAParameters x_public_params =…
santosh singh
  • 27,666
  • 26
  • 83
  • 129
7
votes
1 answer

OpenSSL RSA: Unable to encrypt/decrypt messages longer than 16 bytes

I'm working on a simple program that uses OpenSSL to do basic RSA encryption and decryption. It is working fine for small messages (<16 bytes), but fails for anything over that. I understand that a limitation of public key cryptography is that you…
shanet
  • 7,246
  • 3
  • 34
  • 46
6
votes
1 answer

Free implementation of Elgamal

I'm looking for free implementations of the Elgamal encryption algorithm. As far as I can see, even though it's a widely known algorithm, there seems to be only two free implementations: libgcrypt supports Elgamal encryption pycrypt has…
Jay
  • 9,585
  • 6
  • 49
  • 72
6
votes
2 answers

Can PHP OpenSSL generate private/public key/certificate pairs?

I wonder if PHP's OpenSSL extension can be used to generate private/public key/certificate pairs?
jayarjo
  • 16,124
  • 24
  • 94
  • 138
6
votes
2 answers

How to create JWKS public/private key pair in python?

How to create a JWKS public/private key pair, similar to the one that can be created manually at https://mkjwk.org/, that includes the Key ID (kid) and Key Use (use)? I used the cryptography module for generating a RSA key pair and python-jose for…
Anand Jayabalan
  • 12,294
  • 5
  • 41
  • 52
6
votes
1 answer

OpenSSL: Encrypt a symmetric key with an ECC public key

I have a symmetric key that I would like to encrypt with an ECC public key using OpenSSL. In its high-level portion, EVP, OpenSSL offers a solution to encrypt "an envelop", which is exactly what I need. However, I would like to have these in…
The Quantum Physicist
  • 24,987
  • 19
  • 103
  • 189
6
votes
1 answer

RSACryptoServiceProvider not working in .net core

I have to call a government API, session key needs to be encrypted using public key provided by them. Following code to encrypt the session key is working fine on windows server using .NET framework, but I need to host the API on aws lambda using…
Rahul Khanna
  • 137
  • 2
  • 8
6
votes
2 answers

C#, .Net Core Private key authentication httpClient

We are having a problem with a friend with loading a private certificate to httpHandler. We are using .net core and need to host all aplication in the cloud. Main goal is to get message from SQS and perform some specified API shots after with…
Kacper Werema
  • 448
  • 2
  • 5
  • 18
6
votes
0 answers

How to use a public JWK for ECDH algorithm on iOS 9 and above

I am having problems using a public EC key in JWK format in Objective C with CommonCrypto. I have a java example of what I can't seem to do in Objective C. This is pulled from the Nimbus Jose JWT library at…
6
votes
2 answers

Bouncy Castle PGP sign and encrypt in one pass?

I'm looking for an implementation of Bouncy Castle PGP 'sign and encrypt'. Ideally in one operation, if that makes any difference. I've taken the encrypt example and the signing example and tried to turn it into a 'one pass' encrypt and sign…
Interlated
  • 5,108
  • 6
  • 48
  • 79
6
votes
1 answer

YoBit tapi problems with authetincation

I am trying to write simple application for myself and when i try to call getInfo method i always get a error into the response. Key, sign, method or nonce is incorrect. I found a number of examples but i still can't find mistake in my code. Could…
Alex
  • 77
  • 7
6
votes
4 answers

Public key cryptography with user-chosen passwords?

The whole point is designing a simple system where users are able to send encrypted messages between them (with support from a server). In this scenario, clients have no local storage, so I'm forced to use passwords that users will be able to…
Patonza
  • 6,557
  • 5
  • 25
  • 20