#include <secret_string.h>
Collaboration diagram for secret_string:

Public Member Functions | |
| secret_string (const byte_array &key) | |
| the constructor takes the "key" to be used for encryption. | |
| virtual | ~secret_string () |
| IMPLEMENT_CLASS_NAME ("secret_string") | |
| bool | valid () const |
| returns true if the object was constructed properly. | |
| istring | encrypt_string (const istring &to_encrypt) |
| encrypts "to_encrypt" using our key. | |
| istring | decrypt_string (const istring &to_decrypt) |
| decrypts "to_decrypt" using our key. | |
The same string can be decrypted by someone else that knows the key. The resulting encrypted form can still be treated as a string; it will not contain any null characters except the terminater.
Definition at line 32 of file secret_string.h.
| secret_string::secret_string | ( | const byte_array & | key | ) |
the constructor takes the "key" to be used for encryption.
Definition at line 28 of file secret_string.cpp.
References FUNCDEF, LOG, and ice_key::set().
| secret_string::~secret_string | ( | ) | [virtual] |
| secret_string::IMPLEMENT_CLASS_NAME | ( | "secret_string" | ) |
| bool secret_string::valid | ( | ) | const [inline] |
returns true if the object was constructed properly.
Definition at line 42 of file secret_string.h.
Referenced by decrypt_string(), and encrypt_string().
encrypts "to_encrypt" using our key.
this takes the string "to_encrypt" and turns it into a sequence of char-encoded hexadecimal depicting the encrypted form.
Definition at line 46 of file secret_string.cpp.
References byte_format::bytes_to_string(), ice_key::encrypt(), FUNCDEF, istring::length(), istring::s(), and valid().
Referenced by formal().
decrypts "to_decrypt" using our key.
takes an encrypted string that's represented in hexadecimal and returns the original string.
Definition at line 60 of file secret_string.cpp.
References ice_key::decrypt(), FUNCDEF, array< contents >::observe(), byte_format::string_to_bytes(), and valid().
Referenced by formal().
1.5.1