Diff: [root] @ f71fa57b6c7 | faq | css

xxtea

File created: hellnet/tech/xxtea [Diff]

-- /dev/null++ b/hellnet/tech/xxtea
@@ -1 +1,23 @@
h1. XXTEA address encrypting

Hellnet uses simple, human-readable (well, mostly) links, like this one:

bc. hell://file/14Y6ZQTGF42JB61KX08Q74ZTA0NBMY5FASEG7E2ZG4Q5GWNTJCEZKCB14RXMJQ8573FPPS2888VT116JF5G28RQYAE1RE09Y26G7ZPE?key=X7PQ3TT7GNKVX5VEJBESAY7B85V86VTQR5REXW860HF4T0R86YD&name=Hellnet.hs]

But they have a disadvantage: somebody could modify part of a link and make it unusable, or even worse, make it reference totally different file. Example:

bc. hell://file/14Y6ZQTGF42JB61KX08Q74ZTA0NBMY5FASEG7E2ZG4Q5GWNTJCEZKCB14RXMJQ8573FPPS2888VT116JF5G28RQYAE1RE09Y26G7ZPE?key=X7PQ3TT7GNVKVX5VEJBESAY7B85V86VTQR5REXW860HF4T0R86YD&name=Hellnet.h].

This link looks mostly like original one, but will yield different content. To fight this, "crypt" URIs are used. The technology is simple: we take an URI and encrypt it with XXTEA algorithm, using "hell" in ASCII as key, then insert data into new URI. Here's how our URI looks like:

bc. hell://crypt/N5B45YR26MSHB5E5PH6R7YT635ZNJYTMC5SVGZH3FBP4KVAXWS2HN1Y6V65TS18V54141YM0FKKQXSVV94W0C30X461PM9H3V9DHTKK9MYGNNZ3VS70SFAJB7M6V7Y143TCQR51T939HJ6Z1C1NZ7665X7V8A62C8ZK9SVCYDJJS8XDXPSBAJ6HN1H4J3W7NV161M79CJC6V1F2Z49TDW0WJXAFMX8QTEAKW682H8NEP92EXE3EGDGJFK05ZJ016ASHNM1GR117PKV3R2JYEEPSXACGHFEF704XG62R2DPTZ

And if we change only a single char (name=Hellnet.h), the whole string is visibly changed:

bc. hell://crypt/7T0V608MQDSCA8R3V6SG6H3HFVCXM7ZM63F2GFQC1M1MRFDJGPH9N4KNXA6RF6QHDSP3904JYYHHEGDJCANE3RWWX58VYA9KS4PQVZ5NEYA68MQTZRW2Y8PB75QA293E1S7NEMTHH6MT52S20X4ADCNBB457FHFY8W6RRZQ52MNW7NB8ZXV3ZM9NKW26QHP1V80NF56M7QJ4DVMN15V8RHKYGSWXEQDBE76K36N5MTFCK1K0MRP3NT841YV50Z7SFM134K5V2SNR5P033V9Y7FGZ4CRYPKJ0M9D9XA7VX9ZGW

You can get hell-insert to output crypted URIs by using -p key, and you can encrypt any URI with --crypt-only key.

bc. % ./hell-insert --crypt-only 'hell://file/14Y6ZQTGF42JB61KX08Q74ZTA0NBMY5FASEG7E2ZG4Q5GWNTJCEZKCB14RXMJQ8573FPPS2888VT116JF5G28RQYAE1RE09Y26G7ZPE?key=X7PQ3TT7GNKVX5VEJBESAY7B85V86VTQR5REXW860HF4T0R86YD&name=Hellnet.h'
hell://crypt/7T0V608MQDSCA8R3V6SG6H3HFVCXM7ZM63F2GFQC1M1MRFDJGPH9N4KNXA6RF6QHDSP3904JYYHHEGDJCANE3RWWX58VYA9KS4PQVZ5NEYA68MQTZRW2Y8PB75QA293E1S7NEMTHH6MT52S20X4ADCNBB457FHFY8W6RRZQ52MNW7NB8ZXV3ZM9NKW26QHP1V80NF56M7QJ4DVMN15V8RHKYGSWXEQDBE76K36N5MTFCK1K0MRP3NT841YV50Z7SFM134K5V2SNR5P033V9Y7FGZ4CRYPKJ0M9D9XA7VX9ZGW

By Voker57 on 2011-01-01 16:54:30 +0000