The makefile is written by Rinick and can be compiled into lib under bcc (
[email protected])
There are 4 directories under the compressed package
lib: Contains lib files (and corresponding source files for reference). Copy the two files goozo_crypt.obj and tomcrypt.lib to the lib directory of C++builder before use.
include: header file, copy it to the include directory of C++builder before use
docs(tom): tom provides pdf description of the encryption function library (if you want to know more about the functions, you can read the comments in the header file and source file)
Rinick's ECC: An example and key generator for elliptic curve asymmetric cryptography
Several basic functions are encapsulated into independent functions, making them easier to use.
After #include
, you can use the following function to encrypt: ltc_eax_encrypt(&aes_desc, "111", "222", pchar, pcharC, 300);
There are 300 bytes of content in pchar, which is encrypted and saved to pcharC. The user password is 111 (AnsiString)
222 is the system password (AnsiString), which makes your aes system different from others. It can be regarded as a two-layer password.
aes_desc is the encryption method, the options are:
blowfish_desc, rc5_desc, rc6_desc, rc2_desc, saferp_desc, safer_k64_desc, safer_k128_desc, safer_sk64_desc, safer_sk128_desc, rijndael_desc, aes_desc, rijndael_enc_desc, aes_enc_desc, xtea_desc, twofish_desc, des_ desc, des3_desc, cast5_desc, noekeon_desc, skipjack_desc, khazad_desc, anubis_desc
If there is no special need, just use aes to decrypt: ltc_eax_decrypt(&aes_desc, "111", "222", pcharC, pcharP, 300);
There are 300 bytes of encrypted content in pcharC. After decryption, it is saved to pcharP. The remaining parameters are the same as the memory summary: AnsiString hash=ltc_hash_mem(&md5_desc, pchar, 800);
There are 800 bytes of content in pchar, and his MD5 digest is saved in the hash
md5_desc is the summary mode, the options are:
chc_desc, whirlpool_desc, sha512_desc, sha384_desc, sha256_desc, sha224_desc, sha1_desc, md5_desc, md4_desc, md2_desc, tiger_desc, rmd128_desc, rmd160_desc
If security requirements are high, sha512 or sha384 is recommended. Generally, md5 is enough. File summary: AnsiString hash=ltc_hash_file(&md5_desc, "C:\1.txt");
Calculate the digest of the file C:1.txt and store it in the hash. The remaining parameters are the same as above.
For other functions, please see pdf instructions and source files
The encryption function library supports the following encryption functions that provide a very large integer library encryption support
Blowfish
XTEA
RC5
RC6
SAFER+
Rijndael (aka AES)
Twofish
SAFER (K64, SK64, K128, SK128)
RC2
DES, 3DES
CAST5
Noekeon
Skipjack
Anubis (with optional tweak as proposed by the developers)
Khazad
Chaining Modes (I don’t use this part, I don’t know how to translate it)
Modes come with a start, encrypt/decrypt and set/get IV interfaces.
Mode supported.
ECB
CBC
OFB
CFB
CTR
The hash method supported by the one-way Hash function.
MD2
MD4
MD5 (more commonly used)
SHA-1
SHA-224/256/384/512 (Recommended by Rinick)
TIGER-192
RIPE-MD 128/160
WHIRLPOOL
Information authentication
FIPS-198 HMAC (supports all hash functions)
CMAC, also known as
OMAC1
(Supports all encryption functions)
PMAC Authentication
Pelican MAC
Information encryption authentication mode
EAX Mode
OCB Mode
CCM Mode (NIST spec)
GCM Mode (IEEE spec)
Pseudo-random number generator (used by some other functions)
Yarrow (based algorithm)
RC4
Supports /dev/random, /dev/urandom and Win32 CSP RNG
Fortuna
SOBER-128
public key algorithm
RSA (using PKCS #1 v2.1)
ECC (EC-DSA X9.62 digital signature standard, X9.63 EC-DH, key exchange standard)
Rinick added an ECC encryption and decryption function to implement functions such as software registration.
DSA (users can define their own algorithm to create digital signatures)
Other standards supported
PKCS #1 (v2.1 padding)
PKCS #5
ASN.1 DER for SEQUENCE, INTEGER, BIT STRING, OCTET STRING, OBJECT IDENTIFIER, IA5 STRING, PRINTABLE STRING, UTCTIME, CHOICE and NULL types.