secret_string Class Reference

Provides a way to encrypt a string when given an ice_key. More...

#include <secret_string.h>

Collaboration diagram for secret_string:

Collaboration graph
[legend]
List of all members.

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.

Detailed Description

Provides a way to encrypt a string when given an ice_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.


Constructor & Destructor Documentation

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]

Definition at line 40 of file secret_string.cpp.

References WHACK().


Member Function Documentation

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().

istring secret_string::encrypt_string ( const istring to_encrypt  ) 

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().

istring secret_string::decrypt_string ( const istring to_decrypt  ) 

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().


The documentation for this class was generated from the following files:
Generated on Fri Nov 28 04:30:58 2008 for HOOPLE Libraries by  doxygen 1.5.1