1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
<tt>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br>
<html><br>
<head><br>
<meta content="text/html; charset=ISO-8859-1"<br>
http-equiv="Content-Type"><br>
</head><br>
<body bgcolor="#ffffff" text="#000000"><br>
On 5/2/2010 1:13 PM, Lorenz Quack wrote:<br>
<blockquote cite="mid:4BDDDCF4.6010602@amberfisharts.com" type="cite"><br>
<pre wrap="">Hi Jd,<br>
<br>
On 05/02/2010 10:02 PM, jd wrote:<br>
</pre><br>
<blockquote type="cite"><br>
<pre wrap="">Hi everyone,<br>
<br>
I am trying to implement a simple pub/private key scheme. Want to encrypt bunch of things and decrypt it using public<br>
key (which will be distributed).<br>
</pre><br>
</blockquote><br>
<pre wrap=""><br>
You seem to have some misconceptions about how public key cryptography works.<br>
I suggest you (re-)read up on it. Wikipedia will probably cover the basics.<br>
For starters, by definition you use the *public* key for encrypt and the privat one for decryption.<br>
</pre><br>
</blockquote><br>
<br><br>
Indeed, Wikipedia has an article.&nbsp; And in the first paragraph [1] they<br>
describe one use case for encrypting by public key, and decrypting by<br>
private key, and another use case for encrypting by private key, and<br>
decrypting by public key.&nbsp; It might be appropriate to figure out what<br>
use case the OP has before declaring definitions for a particular use<br>
case.&nbsp; Now as far as what the APIs are called, that might be a<br>
different story :)<br><br>
<br><br>
[1] <b>Public-key cryptography</b> is a <a<br>
href="http://en.wikipedia.org/wiki/Cryptography" title="Cryptography">cryptographic</a><br>
approach which involves the use of asymmetric key algorithms instead of<br>
or in addition to <a<br>
href="http://en.wikipedia.org/wiki/Symmetric_key_algorithm"<br>
title="Symmetric key algorithm" class="mw-redirect">symmetric key<br>
algorithms</a>. Unlike symmetric key algorithms, it does not require a <a<br>
href="http://en.wikipedia.org/wiki/Secure_channel"<br>
title="Secure <br>
channel">secure</a> initial <a<br>
href="http://en.wikipedia.org/wiki/Key_exchange" title="Key exchange">exchange</a><br>
of one or more <a href="http://en.wikipedia.org/wiki/Secret_key"<br>
title="Secret key" class="mw-redirect">secret keys</a> to both sender<br>
and receiver. The asymmetric key algorithms are used to create a<br>
mathematically related key pair: a secret private key and a published<br>
public key. Use of these keys allows protection of the <a<br>
href="http://en.wikipedia.org/wiki/Authenticity" title="Authenticity">authenticity</a><br>
of a message by creating a <a<br>
href="http://en.wikipedia.org/wiki/Digital_signature"<br>
title="Digital <br>
signature">digital signature</a> of a message using<br>
the private key, which can be verified using the public key. It also<br>
allows protection of the <a<br>
href="http://en.wikipedia.org/wiki/Confidentiality"<br>
title="Confidentiality">confidentiality</a> and <a<br>
href="http://en.wikipedia.org/wiki/Integrity" title="Integrity">integrity</a><br>
of a message, by public key <a<br>
href="http://en.wikipedia.org/wiki/Encryption" title="Encryption">encryption</a>,<br>
<br>
encrypting the message using the public key, which can only be<br>
decrypted using the private key.<br>
</body><br>
</html><br>
</tt>
|