https://github.com/empicano/sha2-256
The SHA2-256 hash function in x86 IA-32 assembly
https://github.com/empicano/sha2-256
assembly cryptography hash nasm sha2 sha256 sha512 x86
Last synced: 7 months ago
JSON representation
The SHA2-256 hash function in x86 IA-32 assembly
- Host: GitHub
- URL: https://github.com/empicano/sha2-256
- Owner: empicano
- License: mit
- Created: 2019-01-25T04:34:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-15T20:12:51.000Z (over 5 years ago)
- Last Synced: 2025-03-17T09:45:14.150Z (7 months ago)
- Topics: assembly, cryptography, hash, nasm, sha2, sha256, sha512, x86
- Language: Assembly
- Homepage:
- Size: 18.6 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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](https://en.wikipedia.org/wiki/SHA-2).
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 `The assembly version as well as the Python version expect ascii strings as input.