Giter VIP home page Giter VIP logo

v-crypto's Introduction

V-crypto ๐Ÿ”‘

Attention!
V-crypto has no connection to the official V community and is not maintained by it.
โ†’ It is not recommended to use the algorithms implemented here productively until the status is implemented. As a non-cryptographer, I cannot fully validate the security.

Contributions welcome!


V-crypto provides...

  • a detailed overview of important cryptographic algorithms, protocols and formats,
  • the current implementation status of the official V community.
  • less known but relevant as well as self-developed official algorithms that might be published here.

Cryptographic algorithms and protocols available in V standard library

algorithm category, info importance status
AES symmetric block cipher high, daily use implemented โœ”๏ธ [Git]
bcrypt hash-algorithm high implemented โœ”๏ธ [Git]
blake2(b,s) hash-algorithm moderate implemented โœ”๏ธ [Git] [Git]
blake3 hash-algorithm moderate implemented โœ”๏ธ [Git]
blowfish legacy symmetric block cipher moderate implemented โœ”๏ธ [Git]
blockcipher modes โ†’ CBC, CFB, CTR, OFB Cipher-Block-Chaining, Cipher-Feedback, Counter, Output-Feedback high implemented โœ”๏ธ [Git]
(3)DES legacy symmetric block cipher low implemented โœ”๏ธ [Git]
Ed25519 signature algorithm based on elliptic curves high implemented โœ”๏ธ [Git]
HMAC hash-based message authentication code high implemented โœ”๏ธ [Git]
MD5 legacy hash-algorithm high implemented โœ”๏ธ [Git]
PBKDF2 key derivation function high implemented โœ”๏ธ [Git]
PEM encoding format high implemented โœ”๏ธ [Git]
RAND random number generator high, daily use implemented โœ”๏ธ [Git]
RC4 legacy stream cipher low implemented โœ”๏ธ [Git]
SHA1 legacy hash-algorithm moderate implemented โœ”๏ธ [Git]
SHA256 hash-algorithm high, daily use implemented โœ”๏ธ [Git]
SHA512 hash-algorithm high, daily use implemented โœ”๏ธ [Git]
SHA3 hash-algorithm moderate implemented โœ”๏ธ [Git]
ChaCha20 symmetric stream cipher high, daily use experimental ๐ŸŸก [Git]
ChaCha20-Poly1305 Authenticated encryption with associated data (AEAD) high, daily use experimental ๐ŸŸก [Git]
Poly1305 message authentication code moderate experimental ๐ŸŸก [Git]
SM4 block cipher moderate experimental ๐ŸŸก [Git]

Last Update: 02-09-2024

Cryptographic algorithms and protocols (not officially) planned for V standard library

The V wrapper libsodium [Git] has some of these algorithms.

algorithm category, info importance status
blockcipher modes โ†’ XTS, CCM, GCM XEX-based tweaked-codebook mode with ciphertext stealing, Counter with CBC-MAC (AEAD), Galois/Counter (AEAD) high โŒ
Curve25519 elliptic curve high, daily use thirdparty, non standard โŒ [Git]
DSA legacy signature algorithm low (see [1]) โŒ
ECDH asymmetric crypto based on elliptic curves high, daily use (see [1], [2]), thirdparty, non standard โŒ [Git]
ECDSA signature algorithm based on elliptic curves high, daily use (see [1]) โŒ
HKDF key derivation function moderate thirdparty โŒ [Git]
P-224/256/384/(521) elliptic curves (NIST) high, daily use โŒ
RSA asymmetric crypto high, daily use (see [1]), thirdparty, non standard โŒ [Git]
SSH network protocol high, daily use (see [2]) โŒ
TLS protocol for secure network communication high, daily use (see [2]), wrapper, thirdparty ๐ŸŸก [Git] [Git]
x509 encoding format high wrapper, thirdparty ๐ŸŸก [Git]

Last Update: 02-09-2024

Additional cryptographic algorithms implemented/planned in V-crypto (this Repo)

The V wrapper libsodium [Git] has some of these algorithms.

algorithm category, info importance status
argon2 hash-algorithm / key derivation function high โŒ
Ascon lightweight AEAD moderate โŒ
blockcipher modes โ†’ ECB, EAX, IGE, OCB Electronic-Codebook, encrypt-then-authenticate-then-translate, Infinite Garble Extension, Offset codebook mode (AEAD) moderate experimental (only ECB, IGE) ๐ŸŸก [Git]
brainpoolP(256,384,521)r1 elliptic curve high โŒ
Camellia symmetric block cipher low โŒ
CAST symmetric block cipher moderate โŒ
Curve448 elliptic curve high โŒ
Ed448 signature algorithm based on elliptic curves high โŒ
Grain v1 symmetric stream cipher moderate โŒ
HC-(128,256) symmetric stream cipher moderate โŒ
IDEA symmetric block cipher low โŒ
Kyber(512,1024) key encapsulation mechanism, post-quanten crypto low โŒ
MD4 legacy hash-algorithm low experimental ๐ŸŸก [Git]
RC6 symmetric block cipher low โŒ
RIPEMD160 legacy hash-algorithm moderate experimental ๐ŸŸก [Git]
(X)Salsa20 symmetric stream cipher high experimental ๐ŸŸก [Git]
Serpent symmetric block cipher moderate โŒ
scrypt hash-algorithm / key derivation function high โŒ
TEA, XTEA legacy block cipher low experimental ๐ŸŸก [Git] [Git]
Twofisch symmetric block cipher moderate experimental ๐ŸŸก [Git]
yescrypt hash-algorithm / key derivation function high โŒ

Last Update: 01-07-2024


v_crypto

Installation

v install https://github.com/bstnbuck/V-crypto

Usage

In general, the functionality is easy to understand based on the tests of the respective algorithm. For larger algorithms, a README file with the most important functions follows.

import v_crypto.md4

fn main(){
    // short way to get MD4 hex hash
    println("`test` hashed with MD4 is: "+md4.hexhash("test"))

    // long way to get bytes array
    mut d := md4.new()
    blocksize, bytes_hash := d.checksum('test'.bytes())
    println("input produces a bytes checksum $bytes_hash.hex() with block size: $blocksize")

    d.reset() // with reset, a new empty checksum can be produced
    _, _ := d.checksum('Hi from V_crypto. This is an example of a long long line.'.bytes())
}

Please report security related issues to: bstnbuck (at) proton (dot) me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.