(Translated by https://www.hiragana.jp/)
GitHub - Jemtaly/CryptoXX: A modern, high-speed, easy-to-use object-oriented C++ cryptographic library, aims to simplify the steps of using, making cryptographic algorithms modular and unifying the interface, thus enhancing scalability and flexibility of use. 一个现代、高效、易用的面向对象 C++ 密码库,旨在简化使用步骤,同时使密码算法模块化并统一接口,从而提升可扩展性和使用的灵活性。
Skip to content

A modern, high-speed, easy-to-use object-oriented C++ cryptographic library, aims to simplify the steps of using, making cryptographic algorithms modular and unifying the interface, thus enhancing scalability and flexibility of use. いち个现だいこうこうえきようてきめんこう对象 C++ みつ码库,むねざい简化使用しよう骤,どう时使みつ码算ほう块化并统いちせっこう,从而ひさげます扩展せい使用しようてき灵活せい

License

Notifications You must be signed in to change notification settings

Jemtaly/CryptoXX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CryptoXX

A modern, high-speed, easy-to-use object-oriented C++ cryptographic library, which aims to use the object-oriented features of C++ to simplify the steps of using, and make cryptographic algorithms modular, so that different cryptographic algorithms have a unified interface, thereby improving the convenience of implementation (scalability) and flexibility of use.

Algorithms are highly optimized (while ensuring readability), and several algorithms run more efficiently than classic cryptographic libraries such as OpenSSL.

いち个现だい高速こうそくえきようてきめんこう对象 C++ みつ码库,むねざい利用りよう C++ てきめんこう对象特性とくせい简化使用しよう骤,どう时使みつ码算ほう块化、让不どうみつ码算ほう具有ぐゆう统一てきせっこう,从而ひさげます实现时的便びんとしせいえき扩展せいかず使用しようてき灵活せい

算法さんぽう经过高度こうど优化(どう时保证了读性),种算ほう运行效率こうりつちょう过 OpenSSL とう经典みつ码库。

Currently supported algorithms / 目前もくぜん支持しじてき算法さんぽう

  • Block cipher algorithms (ECB, CBC, CFB, OFB and CTR mode) / 块密码算ほう (工作こうさくしき)
    • DES
    • DES-EDE
    • Blowfish
    • Twofish
    • Serpent
    • Rijndael (AES with variable blocksize and keysize)
    • Camellia
    • SEED
    • ARIA
    • SM4
    • CAST-128
    • CAST-256
    • IDEA
  • Stream cipher algorithms / りゅうみつ码算ほう
    • RC4
    • ChaCha
    • Salsa
    • ZUC (冲之算法さんぽう)
  • Hashing Algorithms (and the corresponding HMAC algorithms) / 哈希算法さんぽう(及对应的 HMAC 算法さんぽう
    • CRC
    • MD5
    • SHA-0, SHA-1
    • SHA-2 (SHA-256, SHA-224, SHA-512, SHA-384)
    • SHA-3, Keccak, SHAKE-128, SHAKE-256
    • BLAKE2 (BLAKE2s-256, BLAKE2s-224, BLAKE2b-512, BLAKE2b-384)
    • BLAKE3 (Experimental)
    • Whirlpool
    • SM3
    • To be continued...

Compiling and running the sample program / 编译并运ぎょうしめせれいほどじょ

Compile / 编译

git clone https://github.com/Jemtaly/CryptoXX
cd CryptoXX
make

Test / 测试

make test

Usage / 使用しよう

  • build/cipher
Usage: build/cipher <algorithm> <mode> <key> [iv]
Supported stream ciphers:
    ChaCha20, Salsa20, RC4, ZUC
Supported stream cipher modes:
    Enc, Dec, Gen
Supported block ciphers:
    ARIA128, Camellia128, Serpent128, Twofish128,
    ARIA192, Camellia192, Serpent192, Twofish192,
    ARIA256, Camellia256, Serpent256, Twofish256,
    CAST128, DES, TDES2K, TDES3K, SEED, Blowfish,
    CAST256, SM4, IDES, AES128, AES192, AES256
Supported block cipher modes:
    ECBEnc, ECBDec, CTREnc, CTRDec, CTRGen,
    CFBEnc, CFBDec, OFBEnc, OFBDec, OFBGen,
    CBCEnc, CBCDec, PCBCEnc, PCBCDec
* Program will read from stdin and write to stdout.
* Key and iv should be hex strings.
build/cipher AES192 ECBEnc 0123456789abcdeffedcba98765432100123456789abcdef < in.txt > out.enc
# Encrypt in.txt in ECB mode with the AES-192 algorithm and output to out.enc.

build/cipher AES192 ECBDec 0123456789abcdeffedcba98765432100123456789abcdef < out.enc
# Decrypt out.enc and output to command line.

build/cipher RC4 Enc 0123456789abcdeffedcba9876543210 > out.enc
# Read from command line and encrypt with RC4 algorithm.

build/cipher SM4 CTRGen 0123456789abcdeffedcba9876543210 0123456789abcdeffedcba9876543210 | head -c 1024 > random.bin
# Generate 1024 random bytes with SM4-CTR mode to random.bin.
  • build/hash
Usage: build/hash <algorithm> [key length] [key]
Available algorithms (Hash only):
    CRC32, CRC64, BLAKE3
Available algorithms (Hash and MAC):
    BLAKE2b384, BLAKE2b512, BLAKE2s256, BLAKE2s224
Available algorithms (Hash and HMAC):
    SHA224, SHA256, SHA3-224, SHA3-256, SHAKE128,
    SHA384, SHA512, SHA3-384, SHA3-512, SHAKE256,
    SM3, MD5, SHA0, SHA1, Whirlpool
* Program will read from stdin and output to stdout.
* Key should be a hex string.
build/hash MD5 < in.txt
# Output the MD5 checksum of in.txt.

build/hash SHA3-256 3 6b6579 < in.txt
# Output the SHA3-256-HMAC of in.txt with a 3-bytes key "\x6b\x65\x79" ("key").

Library usage documentation / みつ码库使用しよう说明

To be continued...

About

A modern, high-speed, easy-to-use object-oriented C++ cryptographic library, aims to simplify the steps of using, making cryptographic algorithms modular and unifying the interface, thus enhancing scalability and flexibility of use. いち个现だいこうこうえきようてきめんこう对象 C++ みつ码库,むねざい简化使用しよう骤,どう时使みつ码算ほう块化并统いちせっこう,从而ひさげます扩展せい使用しようてき灵活せい

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published