📄 readme.txt
字号:
This directory contains some simple example applications for the Botan cryptolibrary. If you want to see something a bit more complicated, check out thestuff in the checks/ directory. Both it and the files in this directory are inthe public domain, and you may do with them however you please.The makefile assumes that you built the library with g++; you'll have to changeit if this assumption proves incorrect.Some of these examples will not build on all configurations of the library,particularly 'bzip', 'encrypt', 'decrypt', and 'hash_fd', as they requirevarious extensions.The examples are fairly small (50-250 lines, with comments). And that's withargument processing, I/O, error checking, etc (which counts for 40+% of most ofthem). This is partially to make them easy to understand, and partially becauseI'm lazy. For the most part, the examples cover the stuff a 'regular'application might need.Feel free to contribute new examples. You too can gain fame and fortune bywriting example apps for obscure libraries!The examples are:* RSA examples (also uses block ciphers, MACs, S2K algorithms)--------rsa_kgen: Generate an RSA key, encrypt the private key with a passphrasersa_enc: Take a public key (generated by rsa_kgen) and encrypt a file using CAST-128, MAC it with HMAC(SHA-1)rsa_dec: Decrypt a file encrypted by rsa_enc* DSA examples--------dsa_kgen: Generates a DSA key, encrypts the private key with a passphrasedsa_sign: Produce a DSA signature for a file. Uses SHA-1dsa_ver: Verify a message signed with dsa_sign* Encryption examples--------encrypt: Encrypt a file in CBC mode with a block cipher of your choice. Adds as MAC for authentication, and compresses the plaintext with Zlib.decrypt: Decrypt the result of 'encrypt'* Hash function examples (also shows different methods of using Pipe)--------hash: Print digests of files, using any chosen hash functionhash_fd: Same as hash, except that it uses Unix file I/O. Requires the pipe_unixfd extensionhasher: Print MD5, SHA-1, and RIPEMD-160 digests of fileshasher2: Same as hasher, just shows an alternate methodstack: A demonstration of some more advanced Pipe functionality. Prints MD5 hashes* Misc examples--------base64: Simple base64 encoding/decoding toolbzip: Bzip2 compression/decompression.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -