This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Anavrins's profile picture

BLAKE-256 hashing algorithm

Started by Anavrins, 05 February 2016 - 12:34 AM
Anavrins #1
Posted 05 February 2016 - 01:34 AM
This is an implementation of the BLAKE-256 hashing algorithm in ComputerCraft, a SHA-3 finalist.

Following my ChaCha20 implementation, I'm also bringing a new hashing algorithm to CC.
It's core structure is somewhat similar to ChaCha20, which makes it very fast (in CC terms), up to 6x the speed of SHA-2 with small inputs.

It's usage is pretty simple, one function digest which takes two arguments, data and salt.
The "data" argument is your usual input, whether it's file contents, passwords, signatures, etc.
The "salt" argument is a built in salt mechanism, such as in password salting and cannot be more than 16 chars/bytes.
The output is a bytetable, which I defined here.
tl;dr, use :toHex() on the output to get the typical hexadecimal encoding.

Download:
pastebin get XRy3LMBG blake
Edited on 30 April 2016 - 04:23 AM
Quartz101 #2
Posted 05 February 2016 - 10:07 AM
So this is more secure than SHA256, right?
wilcomega #3
Posted 05 February 2016 - 01:24 PM
Really cool!
Creator #4
Posted 05 February 2016 - 03:30 PM
Awesome!
Anavrins #5
Posted 06 February 2016 - 02:27 AM
So this is more secure than SHA256, right?
In some way yes, it's strength is in par with sha2, however it is much more faster than it when working with small inputs such as passwords.
Edited on 11 October 2017 - 02:19 AM