Re: Need simple lib for asymetric encryption



"amzoti" <amzoti@xxxxxxxxx> writes:


Oliver Eichler wrote:
Hi,

I am not a crypto specialist, thus please forgive me if I sound a little bit
clueless.

I would like to encrypt some data with key1 and decrypt it again with key2.
If I got it right from all the stuff I have read so far you refere to key1
as 'public key' and to key2 as 'private key'. Normally the public key is
generated from the private key. Thus, who got the private key can always
generate the public key. Is this mandatory?

Public key crypto is abysmally slow. Noone ever actually encrypts data with
a public key. They encrypt a random key for symmetric key crypto (ie the
same key encrypts and decrypts loosely speaking) and use that much faster
symmetric crypto to actually encrypt the data.

Since one HAS to generate both the encryption and decryption key and has to
make sure that the decryption key actually decrypts and that it is not
derivable from any public data, it would seem that the only way is to
derive the public key from the private, or at least both from some other
private data.


What algorithm would I need to satisfy my needs? And is there a simple to
use, light weight C library?

RSA, DSA, Elliptic curve crypto.


I have looked into cryptlib, beecrypt and others.But they all seem to be an
overkill to my problem with a quite hard to understand API. Isn't there
something like :

I think that maybe you need to learn more before trying to impliment
crypto. The algorithm is the least of your worries. Key control is a far
worse worry.


generateKeypair(key1,key2)
encrypt(key1,...)
decrypt(key2,...)

And that's it.


Thanks for help


oliver

Did you look at libtomcrypt?

Maybe it is a better choice if things like PGP or Crypto++ are not.


.



Relevant Pages

  • Re: RSACryptoServiceProvider decrypt with public key
    ... key/decrypt with the private key and encrypt with the private key/decrypt ... encrypt data and send it back to Alice. ... only she can decrypt Bob's data. ... see the public key and the encrypted data, but she could not decrypt Bob's ...
    (microsoft.public.dotnet.security)
  • Re: how to have a gpg public key?
    ... Having just a public key doesn't do you much good. ... You need both a private key and a public key; ... can encrypt and decrypt your messages and you are just ...
    (Debian-User)
  • Re: DECRYPT with PUBLIC key (how to?)
    ... values in my application which would be decoded with my own public key which ... This is a very stupid thing to think that you can encrypt with private ... Private key operations often uses CRT ... Signature schemes and Encryption schemes have completely different ...
    (microsoft.public.dotnet.security)
  • Re: private to public decrypt now working
    ... would have the private key, all vice presidents would have a public key. ... All vice's could encrypt and only president could decrypt. ...
    (microsoft.public.dotnet.security)
  • [OT] Re: Basic question about Public Private Key Pairs
    ... > and private keys allow me to decrypt, but vice versa is not possible (or ... a public key and a corresponding private key. ... You can encrypt something with each key; ...
    (microsoft.public.dotnet.security)