|
After a good night's sleep, all I need is
coffee :) First up today is Martin Kobetic, who's going to reprise
his Smalltalk Solutions talk on Cryptography. He's going to cover
various algorithms that we've implemented in Cincom Smalltalk, and
how to use them with other systems.
That's Martin on the left, starting his talk |
Martin's giving a background on public key algorithms - the
basic points are:
- Hard to derive the private key from the public key
- The keys are based on hard problems
The system is simple to use: You encrypt with the public key, and you decrypt with the private key. This way, anyone can encrypt, but only people with the private key can read the messages. Using this:
keys := RSAKeyGenerator keySize: 512.
allice := RSA new publicKey: keys publicKey.
msg := 'Hello World' asByteArrayEncoding: #utf8.
msg := alice encrypt: msg.
bob := RSA new privateKey: keys privateKey.
msg := bob decrypt: msg.
plain := msg asStringEncoding: #utf8.
Of course, you need to cooperate to generate the private key. You use the public key to establish a private key, and then you need to manage that. The above is just an example using RSA; we also support Diffie-Hellman and others.
There's also support for digital signing and hash functions, which can be used for:
- integrity
- authentication
- non-repudiation
The idea behind digital signatures is that they are authentic, non-reusable, and unalterable. You sign with a private key, and then verify with the public key. You get a boolean response as to the authenticity of the message.
"sign"
alice := RSA new privateKey: keys privateKey.
msg := 'Hello World' asBytArray.
sig := alice sign: msg.
sig asHexString.
"verify"
bob := RSA new publicKey: keys publicKey.
bob verify: sig of: msg.
We also support DSA, including the newer modifications to it. Using DSA is the same as RSA (above), using class DSA instead.
Technorati Tags:
esug, smalltalk