All Projects → johanns → sha3

johanns / sha3

Licence: MIT license
SHA3 for Ruby is a XKCP based native (C) binding to SHA3 (FIPS 202) cryptographic hashing algorithm

Programming Languages

c
50402 projects - #5 most used programming language
ruby
36898 projects - #4 most used programming language
C++
36643 projects - #6 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to sha3

hash-wasm
Lightning fast hash functions using hand-tuned WebAssembly binaries
Stars: ✭ 382 (+991.43%)
Mutual labels:  hash, keccak, sha3
noble-hashes
Audited & minimal JS implementation of SHA2, SHA3, RIPEMD, BLAKE2/3, HMAC, HKDF, PBKDF2 & Scrypt
Stars: ✭ 213 (+508.57%)
Mutual labels:  hash, keccak, sha3
libkeccak
[Basically feature complete] Keccak-family hashing library
Stars: ✭ 53 (+51.43%)
Mutual labels:  keccak, sha3
ngx http hmac secure link module
HMAC Secure Link module for NGINX.
Stars: ✭ 47 (+34.29%)
Mutual labels:  hash, sha3
h2c-rust-ref
Hash to curves - Rust reference implementation
Stars: ✭ 21 (-40%)
Mutual labels:  hash
Python Hashes
Interesting (non-cryptographic) hashes implemented in pure Python.
Stars: ✭ 213 (+508.57%)
Mutual labels:  hash
Bcrypt
A Java standalone implementation of the bcrypt password hash function. Based on the Blowfish cipher it is the default password hash algorithm for OpenBSD and other systems including some Linux distributions. Includes a CLI Tool.
Stars: ✭ 207 (+491.43%)
Mutual labels:  hash
Next Build Id
Easily set your `next build` BUILD_ID to the latest git commit hash
Stars: ✭ 203 (+480%)
Mutual labels:  hash
hash-avatar
🌈 Hash avatar algorithm
Stars: ✭ 33 (-5.71%)
Mutual labels:  hash
bcrypt
BCrypt is a password hashing function
Stars: ✭ 138 (+294.29%)
Mutual labels:  hash
Mercury
Mercury is a hacking tool used to collect information and use the information to further hurt the target
Stars: ✭ 236 (+574.29%)
Mutual labels:  hash
Hackers Tool Kit
Its a framework filled with alot of options and hacking tools you use directly in the script from brute forcing to payload making im still adding more stuff i now have another tool out called htkl-lite its hackers-tool-kit just not as big and messy to see updates check on my instagram @tuf_unkn0wn or if there are any problems message me on instagram
Stars: ✭ 211 (+502.86%)
Mutual labels:  hash
patchmap
A fast and memory efficient hashmap using sorting to resolve collisions
Stars: ✭ 41 (+17.14%)
Mutual labels:  hash
Dhash
Python library to calculate the difference hash (perceptual hash) for a given image, useful for detecting duplicates
Stars: ✭ 209 (+497.14%)
Mutual labels:  hash
bookshelf-secure-password
A Bookshelf.js plugin for handling secure passwords
Stars: ✭ 24 (-31.43%)
Mutual labels:  hash
Phash
pHash - the open source perceptual hash library
Stars: ✭ 208 (+494.29%)
Mutual labels:  hash
Python Xxhash
Python Binding for xxHash
Stars: ✭ 226 (+545.71%)
Mutual labels:  hash
Dictionary
A dictionary data type with a fast b-tree based search
Stars: ✭ 39 (+11.43%)
Mutual labels:  hash
Clhash
C library implementing the ridiculously fast CLHash hashing function
Stars: ✭ 220 (+528.57%)
Mutual labels:  hash
Nsec
A modern and easy-to-use cryptographic library for .NET Core based on libsodium
Stars: ✭ 217 (+520%)
Mutual labels:  hash

sha3

Gem Version Ruby

SHA3 for Ruby is a XKCP based native (C) binding to SHA3 (FIPS 202) cryptographic hashing algorithm.

Warning

  • Please do NOT use SHA3 to hash passwords -- use a slow hashing function instead (e.g.: pbkdf2, argon2, bcrypt or scrypt)
  • Version 1.0 introduces new API and is incompatible with previous versions (0.x).

Module details

SHA3::Digest: A standard Digest subclass. The interface, and operation of this class are parallel to digest classes bundled with MRI-based Rubies (e.g.: Digest::SHA2, and OpenSSL::Digest).

See documentation for Ruby's Digest class for additional details.

Installation

gem install sha3

Usage

require 'sha3'

Valid hash bit-lengths are: 224, 256, 384, 512.

:sha224  :sha256  :sha384  :sha512

# SHA3::Digest.new(224) is SHA3::Digest.new(:sha224)

Alternatively, you can instantiate using one of four sub-classes:

SHA3::Digest::SHA224.new() # 224 bits
SHA3::Digest::SHA256.new() # 256 bits
SHA3::Digest::SHA384.new() # 384 bits
SHA3::Digest::SHA512.new() # 512 bits

Basics

# Instantiate a new SHA3::Digest class with 256 bit length
s = SHA3::Digest.new(:sha256)

# OR #

s = SHA3::Digest::SHA256.new()

# Update hash state, and compute new value
s.update "Compute Me"

# << is an .update() alias
s << "Me too"

# Returns digest value in bytes
s.digest
# => "\xBE\xDF\r\xD9\xA1..."

# Returns digest value as hex string
s.hexdigest
# => "bedf0dd9a15b647..."

### Digest class-methods: ###

SHA3::Digest.hexdigest(:sha224, "Hash me, please")
# => "200e7bc18cd613..."

SHA3::Digest::SHA384.digest("Hash me, please")
# => "\xF5\xCEpC\xB0eV..."

Hashing a file

# Compute the hash value for given file, and return the result as hex
s = SHA3::Digest::SHA224.file("my_fantastical_file.bin").hexdigest

# Calling SHA3::Digest.file(...) defaults to SHA256
s = SHA3::Digest.file("tests.sh")
# => #<SHA3::Digest: a9801db49389339...>

Development Dependencies

  • Native build tools (e.g., Clang/LLVM, GCC, Minigw, etc.)
  • Gems: rubygems-tasks, rake, rspec, yard

Testing

Call rake to run the included RSpec tests.

Only a small subset of test vectors are included in the source repository; however, the complete test vectors suite is available for download. Simply run the tests.sh shell script (available in the root of source directory) to generate full byte-length RSpec test files.

sh tests.sh

Rubies

Supported Ruby versions:

  • MRI Ruby 2.6 - 3.1

Credits

XKCP by Keccak team: https://keccak.team/index.html

Copyright

Copyright (c) 2012 - 2022 Johanns Gregorian (https://github.com/johanns)

See LICENSE.txt for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].