I'm trying to create DB using sqlcipher and then access it by using hex value of password key.
According to description from github (https://github.com/sjlombardo/sqlcipher) key is hashed by sha256 algorithm and then used to cipher DB. There is a choice to provide the key in plain and hex form through PRAGMA directive. And if I use plain version it all works correctly, but I unable to access DB with hex key value.
For example in my case key is 'demo' and when I use PRAGMA key='demo'
all works.
I got sha256 with:
echo -n demo | shasum -a256 2a97516c354b68848cdbd8f54a226a0a55b21ed138e207ad6c5cbb9c00aa5aea
and then provided it to PRAGMA directive according to instructions in sqlite3_exec call:
sqlite3_exec(db, "PRAGMA key = x'2a97516c354b68848cdbd8f54a226a0a55b21ed138e207ad6c5cbb9c00aa5aea'", NULL, NULL, NULL);
but this doesn't work.
What is the hex value of key should I provide to PRAGMA directive?