Prepare the encryption context by a cipher key string.
void mco_crypt_init_ctx(mco_crypt_ctx_t* crypt_ctx, const char * cipher_key);
crypt_ctx | The address of the encryption context to initialize |
cipher_key | The encryption key string |
This function prepares the encryption context by a cipher key string. This context (which is actually an encryption data table) is utilized by functions performing encryption / decryption. Note that this API assumes use of a symmetric-key algorithm which has no separated encrypt() and decrypt() functions. A single function encrypts information on first pass and decrypts it on the next.
void | No value returned |
{ mco_db_h con; MCO_RET rc; const char *cipher = "my cipher key"; mco_crypt_ctx_t crypt_ctx; ... rc = mco_db_connect( db_name, &con ); if ( MCO_S_OK == rc ) { algorithm = mco_crypt_init_ctx( &crypt_ctx, cipher); ... mco_db_disconnect(con); } }