§ 4.40 - [encrypt] Built-InMnemonic aid: encrypt for ENCRYPT content See also: [decrypt] (Optionally re-) encrypts content (optionally from a hexadecimal block produced by a previous invocation of [encrypt] ) into a hexadecimal block. This encryption is asymmetrically reversible; therefore multiply encrypted content is not sensitive to order of decryption. It is useful to think of this as "multiple locks on a box"; you can put such locks on in any order, and take them off in any order. [encrypt (mode=1,)(breakat=N,)(seed=N,)(icount=N,)(salt=string,)(again=1,)content] The mode=1 option tells [encrypt] to use a more robust random number generator. Use of mode=1 is recommended. The mode option, if supplied, must be either 0 (which is also the default) or 1, and must match the mode used in the corresponding [decrypt] operation(s.) The breakat=N option sets how many columns the result returns in. The default is 16 columns. This does not affect the encryption decoding or re-encoding, both of which only "see" sequences of hexadecimal digits. In mode=0, the default mode, the seed=N option is a positive integer that affects the encryption encoding. The default is 1. In mode=1, the seed can be an integer or a string. The icount=N option is a positive integer that affects the encryption encoding. The default is 1. The salt=string option is a text string that affects the encryption encoding. The default is no salt. The again=1 option allows for additional levels of encryption and decryption. This, in turn, is the the enabling mechanism which provides for double-locked box, or triple-exchange, two-party, non-public, non-shared, dual-key-based encryption. Here's how that works:
As you can see from the above sequence, at no time does party one have party two's key, and at no time does party two have party one's key. In addition, the information in the box is never transferred in an unlocked (unencrypted) box. Here's the sequence to use; p1=party one and p2=party two:
Tip: The trick to opaque encryption is to use a unique, secret seed and a long, unique, secret salt; encrypt; then encrypt using again=1 using a different seed and a different salt; repeat as many times as possible with different seeds and salts. In terms of the above double-locked-box approach, each party may (and should) use multiple levels of encryption to create their lock on the box.
The saltless examples on this page are demonstrations only. You should always use a long, unique salt. Multiple levels of encryption are created when [encrypt] is used normally first, then with the again=1 parameter on each subsequent result. Decrypting multiply-encrypted blocks is done by running [encrypt] with again=1 on all but the last result, in any order, and then running [decrypt] on the final result. Here's a three-level example demonstrating out-of order decryption:
[encrypt (mode=1,)(breakat=N,)(seed=N,)(icount=N,)(salt=string,)(again=1,)content] [local z [encrypt simple usage]] [v z] [decrypt [v z]] [local x [encrypt breakat=64,seed=19,icount=5,salt=meddling manatee,this is a silly test]] [v x] [decrypt seed=19,icount=5,salt=meddling manatee,[v x]] Double-locked box, or "triple exchange" dual-non-public-key encryption: 1 [local unLockedBox secret message][v unLockedBox] 2 [local oneLockedBox [encrypt seed=1234,breakat=64,[v unLockedBox]]][v oneLockedBox] 3 [local twoLockedBox [encrypt again=1,seed=5678,breakat=64,[v oneLockedBox]]][v twoLockedBox] 4 [local oneLockedBoxB [encrypt again=1,seed=1234,breakat=64,[v twoLockedBox]]][v oneLockedBoxB] 5 [decrypt seed=5678,[v oneLockedBoxB]] 73696F7C5154D5B8 716F2D16 simple usage 223E677F9DAF2173BEF8CF11BEA206C444E0A575 this is a silly test Double-locked box, or "triple exchange" dual-non-public-key encryption: 1 secret message 2 0B3FA7A5507E167D31D64945D2EC 3 21EB811AEDCA92EBDF7F19D70FB9 4 59B145CDD8C0A4FB8BDA23F3BA30 5 secret message
73696F7C5154D5B8
716F2D16
simple usage
223E677F9DAF2173BEF8CF11BEA206C444E0A575
this is a silly test
Double-locked box, or "triple exchange" dual-non-public-key encryption:
1 secret message
2 0B3FA7A5507E167D31D64945D2EC
3 21EB811AEDCA92EBDF7F19D70FB9
4 59B145CDD8C0A4FB8BDA23F3BA30
5 secret message
Keyboard Navigation
, Previous Page . Next Page t TOC i Index |