(Please not that this procedure might not necessarily be a good way of deriving a key from a password. It is just an example.)
Using VDCHunk this would look like this (instances "data" and "key" are supposed to be already created):
key->add_string("NotAGoodPassword"); // Should come from GUI key->add_byte(8); x->add_byte(15); // Whatever you want here .... key->sha512(); // SHA512 hashing algorithm key->del_bytes(24,63); // Results in 64 bytes, we need 24 key->odd_parity_all(); // Odd parity for key material data->tdes_encipher(key); // Encypt data block data->write_hex_file("result.hex"); // Write result in file
Since this library is used by several of my and my friends programs, I decided to make it available to everybody by putting it on this site. Feel free to use and modify it under the terms of the GNU General Public License. The most probable reason, however, why you ended up on this page, is that you encountered another program that requires VDChunk. In that case just download and unzip the source, read the INSTALL file and follow the instructions.