Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Matthews Lab
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Timechain
(section)
Page
Discussion
British English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Time-lock encryption = Our design starts with something called “[http://tinyurl.com/lr5qfn3 time-lock encryption]” which is a secure way to send messages to the future. The basic idea behind time-lock encryption is that you start with some random text and then repeatedly apply some computable function to scramble the input. The output of this function then becomes the input to the next function and you keep applying it for however long you want your time-lock to last. When you’re done with this process, the final key becomes the key that you use to time-lock encrypt information. Now encrypt something and throw away that key so you’re only left with the random input you started with and now in order to decrypt your message, you would have to repeat every lengthy computation used to produce the time-locked key. <syntaxhighlight lang="python3"> import hashlib, time def timelock(duration, iv): #Starting time. last_run = time.time() #Generate time-lock encryption key. elapsed = int(time.time() - last_run) key = hashlib.sha256(iv).digest() while elapsed < duration: key = hashlib.sha256(key).digest() elapsed = int(time.time() - last_run) #Time-lock encrypted key. return key #How long should the time-lock last? duration = 10 #Starting text or "IV." iv = b"Did you know shinigami love apples?" #Lets do this. key = timelock(duration, iv) #Some function here to use that key for an encryption algorithm. #I'll show you how to do this later on. plaintext = "secret stuff" cipher = make_aes_cipher(key) ciphertext = encrypt(plaintext, cipher) """ .:. Ciphertext is now "time-locked" discarding the key forces the recipient of the ciphertext to have to repeat the same process used to generate the key. Pretty cool, right? """ </syntaxhighlight> The function used to garble text is called a [https://en.wikipedia.org/wiki/Cryptographic_hash_function cryptographic hash function]. Its most important property in this context is that it’s [https://en.wikipedia.org/wiki/One-way_function one-way] - you can’t reverse a cryptographic hash to produce the input used to generate the hash without using a [https://en.wikipedia.org/wiki/Brute-force_attack brute force attack] which isn’t feasible on large [https://en.wikipedia.org/wiki/Key_space_%28cryptography%29 key spaces] (so lets just say a good hash function is secure.) When you’ve done the computations necessary to generate the final value you can use this value to encrypt a private key used in a [https://en.wikipedia.org/wiki/Public-key_cryptography public key scheme] (like [https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29 RSA].) That way you don’t need to produce a new key every time you want to time-lock something and everyone is free to use the public key.<span id="introducing-the-timechain"></span>
Summary:
Please note that all contributions to Matthews Lab may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Matthews Lab:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)