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
11
votes
5 answers

Encrypting large files using a public key

I need to encrypt a 100KB file using a public key. I've been reading some posts claiming that it is not practical to directly encrypt large files using a public key, and that the preferred method is to encrypt the file using a symmetric key and then…
wanderingbear
  • 1,002
  • 3
  • 11
  • 18
11
votes
3 answers

Encryption and decryption with private key in Java

After I have read articles about Cryptography(Symmetric and Asymmetric) methods.Many articles are telling that Private key is used to encrypt and decrypt data.Public key is used to encrypt data.But When I try to start implementing in Java I can't…
10
votes
3 answers

RSA Encryption of large data in C#

This is my first post, so hope I haven't missed anything important. I'm doing a project in C# where I need to use public/private key encryption to encrypt a message and then send it over an SSL connection. I chose to use the RSACryptoService, as…
Simon Langhoff
  • 1,395
  • 3
  • 18
  • 28
10
votes
2 answers

RSA Encryption in Java: Cross Platform Issues?

The Situation I'm working with RSA encryption in Java. I'm trying to encrypt data on an HTC Saphire (32B) developer phone equipped with Cyanogenmod's Android 2.2 and then decrypt said data on a 64 bit server running Mandriva Linux 2010. I am using…
10
votes
1 answer

RSA keys in Perl

I have simple RSA encoding/decoding script, such as: use Crypt::RSA; my $rsa = new Crypt::RSA; my($public, $private) = $rsa->keygen( Size => 2048 ) or die $rsa->errstr(); my $email = '...'; my $em = $rsa->encrypt( Message…
Ωmega
  • 42,614
  • 34
  • 134
  • 203
9
votes
7 answers

Ok, so I've encrypted my data now where do I hide the key?

I have a database that contains sensitive information. I can encrypt / decrypt the data on the read write operations. The problem is that I need to store the key in the application. If someone has hacked their way in such they have access to the…
Preston
  • 3,273
  • 4
  • 26
  • 35
9
votes
2 answers

How to I securely store social security numbers in a database?

I'm working on a web application which the users will need to submit their social security numbers. I would like to use asymmetric keys for encryption so if the web server is compromised the private key will still be safe. The application won't be…
harlyd
  • 91
  • 1
  • 1
  • 4
9
votes
6 answers

Delphi asymmetric encryption

I'm looking for a Delphi implementation of an asymmetric encryption algorithm without any dependencies on external DLLs. Is there any available? My goal is to encrypt/decrypt a string (or array of bytes) using a public/private key pair.
Carlos Barbosa
  • 3,083
  • 5
  • 30
  • 30
9
votes
3 answers

Seckey from public key string from server in Swift

I want to encrypt data using RSA , I tried to generate the key in my code and it's working , But what I actually need is to get the public key as a string from server and then use it as Seckey so I can use it to encrypt data using RSA, I tried this…
9
votes
1 answer

Java RSA Encrypt - Decrypt .NET

I am encrypting on JAVA using RSA and attempting to decrypt using .NET. I am including my JAVA code and .NET code in hopes that someone has some experience with this sort of thing. JAVA Code: byte[] modulusBytes =…
badMonkey
  • 1,687
  • 1
  • 22
  • 23
9
votes
2 answers

How to use nonces in asymmetric encryption (libsodium)?

I am writing an app where users can communicate between devices with end to end encryption. For this I use the libsodium encryption library. The asymmetric encryption function, crypto_box(...) requires a nonce as one of the arguments. I am a bit…
joakimb
  • 553
  • 1
  • 7
  • 19
9
votes
5 answers

Is there a physical lock that can demonstrate asymmetric crytographic principles?

I wish to demonstrate asymmetric encryption using real-world locks. For example, I want to write a secret on a piece of paper and deposit it in a locked box. Is there a lock I can buy that comes with two keys, one that only locks the lock and…
Adam Paynter
  • 46,244
  • 33
  • 149
  • 164
9
votes
4 answers

Two private key asymmetric encryption - possible?

I am wondering if there exists some asymmetric encryption algorithm that would work with two different private keys, so that the encrypted message can be decrypted by either one of such private keys?
8
votes
1 answer

Java: How to create a RSA Public Key from the String

I have the byte array of the RSA Public Key. I found on the internet that I can create a real PublicKey object of it by using this code: PublicKey publicKey = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(bytes)); But…
Martijn Courteaux
  • 67,591
  • 47
  • 198
  • 287
7
votes
1 answer

X509Certificate encryption/decryption

I'm just starting to learn XML security. We have VS-2005 & ASP.Net 2.0. I want to send XML to a outside URL and it needs to be encrypted. I'm doing exactly what the MSDN articles ms229744 & ms229943 are doing, but when doing the DecryptDocument()…
john pavelka
1 2
3
39 40