<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 5/2/2010 1:13 PM, Lorenz Quack wrote:
<blockquote cite="mid:4BDDDCF4.6010602@amberfisharts.com" type="cite">
<pre wrap="">Hi Jd,
On 05/02/2010 10:02 PM, jd wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi everyone,
I am trying to implement a simple pub/private key scheme. Want to encrypt bunch of things and decrypt it using public
key (which will be distributed).
</pre>
</blockquote>
<pre wrap="">
You seem to have some misconceptions about how public key cryptography works.
I suggest you (re-)read up on it. Wikipedia will probably cover the basics.
For starters, by definition you use the *public* key for encrypt and the privat one for decryption.
</pre>
</blockquote>
<br>
Indeed, Wikipedia has an article. And in the first paragraph [1] they
describe one use case for encrypting by public key, and decrypting by
private key, and another use case for encrypting by private key, and
decrypting by public key. It might be appropriate to figure out what
use case the OP has before declaring definitions for a particular use
case. Now as far as what the APIs are called, that might be a
different story :)<br>
<br>
[1] <b>Public-key cryptography</b> is a <a
href="http://en.wikipedia.org/wiki/Cryptography" title="Cryptography">cryptographic</a>
approach which involves the use of asymmetric key algorithms instead of
or in addition to <a
href="http://en.wikipedia.org/wiki/Symmetric_key_algorithm"
title="Symmetric key algorithm" class="mw-redirect">symmetric key
algorithms</a>. Unlike symmetric key algorithms, it does not require a <a
href="http://en.wikipedia.org/wiki/Secure_channel"
title="Secure
channel">secure</a> initial <a
href="http://en.wikipedia.org/wiki/Key_exchange" title="Key exchange">exchange</a>
of one or more <a href="http://en.wikipedia.org/wiki/Secret_key"
title="Secret key" class="mw-redirect">secret keys</a> to both sender
and receiver. The asymmetric key algorithms are used to create a
mathematically related key pair: a secret private key and a published
public key. Use of these keys allows protection of the <a
href="http://en.wikipedia.org/wiki/Authenticity" title="Authenticity">authenticity</a>
of a message by creating a <a
href="http://en.wikipedia.org/wiki/Digital_signature"
title="Digital
signature">digital signature</a> of a message using
the private key, which can be verified using the public key. It also
allows protection of the <a
href="http://en.wikipedia.org/wiki/Confidentiality"
title="Confidentiality">confidentiality</a> and <a
href="http://en.wikipedia.org/wiki/Integrity" title="Integrity">integrity</a>
of a message, by public key <a
href="http://en.wikipedia.org/wiki/Encryption" title="Encryption">encryption</a>,
encrypting the message using the public key, which can only be
decrypted using the private key.
</body>
</html>