项目作者: empicano

项目描述 :
The sha2-256 cryptographic hash function realized in x86 IA-32 assembly
高级语言: Assembly
项目地址: git://github.com/empicano/sha2-256.git
创建时间: 2019-01-25T04:34:50Z
项目社区:https://github.com/empicano/sha2-256

开源协议:MIT License

下载


This project realizes the SHA2 cryptographic hash function for Linux in NASM syntax IA-32 assembly. An explanation with pseudocode of SHA2 can be found on Wikipedia.

I intended it mostly as an assembly programming exercise, whilst also wanting to know how a hash function works on the inside. I had no real aspirations for extraordinary performance. I worked my way down from pseudocode to an implementation in Python, followed by a translation of the latter to assembly code.

Assemble and run with:

  • nasm -f elf32 sha2-256.asm -o sha2-256.o
  • ld -m elf_i386 sha2-256.o -o sha2-256
  • ./sha-256 <string to hash>

The assembly version as well as the Python version expect ascii strings as input.