Jump to content

BLAKE-256 hashing algorithm

api lua networking

4 replies to this topic

#1 Anavrins

  • Members
  • 775 posts

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.

pastebin get XRy3LMBG blake

Edited by Anavrins, 30 April 2016 - 05:23 AM.

#2 Quartz101

  • Members
  • 141 posts
  • Location/dev/nvme0n1

Posted 05 February 2016 - 10:07 AM

So this is more secure than SHA256, right?

#3 wilcomega

  • Members
  • 466 posts
  • LocationHolland

Posted 05 February 2016 - 01:24 PM

Really cool!

#4 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 05 February 2016 - 03:30 PM


#5 Anavrins

  • Members
  • 775 posts

Posted 06 February 2016 - 02:27 AM

View PostQuartz101, on 05 February 2016 - 10:07 AM, said:

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 by Anavrins, 11 October 2017 - 03:19 AM.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users