Questions tagged [encryption-asymmetric]

A type of encryption which uses one key to encrypt a message and another to decrypt the message.

In asymmetric encryption, also referred as public-key cryptography, there are two related keys--a key pair. A public key is made freely available to anyone who might want to send you a message. A second, private key is kept secret, so that only you know it.

594 questions
5
votes
5 answers

RSA: Encrypting message using multiple keys

Is it possible to get additional security by encrypting a message using 2 or more RSA keys? EDIT: A few clarifications: The context I am most interested in doing this for is encrypting a randomly generated symmetric key. I don't want to limit the…
5
votes
2 answers

Decrypting “long” message encrypted with RSA java

Hi this is the same question, that was asked two years ago: Java/JCE: Decrypting “long” message encrypted with RSA I had a large byte array and rsa keypair, initiated by value 1024. Using rsa encryption and the specified size of the key is strong…
Denis
  • 1,130
  • 3
  • 17
  • 32
5
votes
2 answers

Generate EC Diffie-Hellman public and private key pair

I need to generate an EC Diffie Hellman key pair. I am using the secp256r1 named curve, and OpenSSL. This is what I have with me so far: unsigned char *ecdh(size_t *secret_len) { EVP_PKEY_CTX *pctx, *kctx; EVP_PKEY_CTX *ctx; unsigned…
5
votes
2 answers

How to change the passphrase of a private key using PHP's OpenSSL module?

I'm using PHP's OpenSSL module for asymmetric encryption; openssl_pkey_new(), openssl_pkey_export(), and openssl_pkey_get_details() to create the keypair, and openssl_public_encrypt and openssl_private_decrypt() to encrypt and decrypt data. How can…
5
votes
1 answer

Secure login within Phonegap

I'm creating a Phonegap application which needs to allow a user to log into our Central Authentication Service. My concern is that, since the files on the Phone are being loaded locally (via file://), there isn't security like there would be over an…
Buns of Aluminum
  • 2,439
  • 3
  • 26
  • 44
4
votes
1 answer

SSL + Additional Layer of Encryption

I'm wondering what to do in the case of a customer asking for a second layer of encryption on top of SSL? For example, I have an SSL tunnel, and the customer wants me to then use symmetric key encryption on data flowing through that tunnel. The…
4
votes
1 answer

Java Decrypt with NodeJS Encrypt padding and oaepHash

I need to decrypt some information coming from an external service built with NodeJS. This service ask for a RSA (2048) public key in pem format in base64, in order to encrypt the information. I am creating the key pair in Java: KeyPairGenerator…
4
votes
3 answers

RSA encryption: Is it possible to revoke a public/private key pair in peer-to-peer?

I'm creating an app (C#) that is going to send some messages around the network. Outgoing messages will be signed by a private key, incoming messages decrypted with a private key. In case someone steals the private key, I want to be able to revoke…
4
votes
0 answers

Getting invalidCiphertextException: null when decrypting data which was encrypted with kms public key

I am building a POC based on asymmetric encryption where the public key from KMS will be downloaded and used on the client side to encrypt sensitive data and once that data is received at the server end it needs to be decrypted using KMS decrypt…
4
votes
1 answer

How does RSA work while encrypting a sentence?

I'm learning about RSA encryption and I have understood how to encrypt a single letter. I have problems understanding how does RSA work while encrypting a sentence. For eg: Single letter encryption: A Encryption= A^e (mod n) But in a sentence. For…
Ethan
  • 77
  • 1
  • 9
4
votes
3 answers

C# How do I do encryption?

I'm not asking for a tutorial with code, I'm trying to do the research, but I want to make sure I'm asking the right questions. What's the best form of encryption I can use out of the box with .NET? Public/Private key, where do I store these things…
4
votes
2 answers

Key Size in RSA C# is not changing !

I am generating key pair and store them in xml file using ToXmlString(true); I need to set the key size to 2048 according to the MSDN the only place to do this is from the constructor of the RSACryptoServiceProvider private void…
muhammadelmogy
  • 153
  • 2
  • 9
4
votes
0 answers

Passing sensitive data to Firebase cloud function

I want to pass the user's password to a cloud function to do stuff with through an HTTP cloud function. I was thinking about using RSA encrytion with a private key stored in the index.js file used for writing cloud functions and the public key being…
4
votes
2 answers

Asymmetric deterministic encryption (RSA) with Ruby

I was wondering if anyone knows of a way to deterministically encrypt a value in Ruby using an asymmetric encryption algorithm. For most use-cases one only cares that when you encrypt 'A' you get 'A' back when you decrypt it, that is you do not care…
DBA
  • 653
  • 1
  • 5
  • 14
4
votes
1 answer

RsaSecurityKey does not take RSAParameters as arguments

I want to generate a JWT Token in .Net 4.5 using an asymmetric key that I provide myself, but I am running into a few issues with the System.IdentityModel.Tokens.Jwt, version 4.0.3. Preferably I would create my own 2048 keys, like provider allows me…
user7101139
  • 71
  • 1
  • 5