[guardian-dev] cacheword usage

Massimo Canonico mex at di.unipmn.it
Wed May 25 05:21:35 EDT 2016


Hi all,

I'm wondering if the following code is right in order to create a 
secretkey with cacheword and if this key is directly used by chatsecure 
to encrypt a DB with SQLCipher. From my test, it seems that I'm missing 
some step.

I hope you can help me.

After my signature, the code used. The question is: is x_rawSecretKey 
the right key to use with SQLCipher?

Best,

Massimo

String encodedSecret = 
"AAAAAQAAH0AcWGkQhZcNYf8pD5hSleo7zk5Qy63/Ueh4zb46nV+vjH14Km2nbIteiJNPx+nwcVB4Dre7xB9LLElEAm/jF4XdVsuqF2HuyspDQNxU";

String passphrase = "mypassword2016";

char[] x_passphrase = passphrase.toCharArray();

byte[] preparedSecret = 
android.util.Base64.decode(encodedSecret,Base64.DEFAULT);

SerializedSecretsV1 ss = new 
SerializedSecretsLoader().loadSecrets(preparedSecret);

byte[] x_rawSecretKey = null;

PassphraseSecretsImpl crypto = new PassphraseSecretsImpl();

*x_rawSecretKey* = crypto.decryptWithPassphrase(x_passphrase,ss);


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mayfirst.org/pipermail/guardian-dev/attachments/20160525/65e6e3d6/attachment.html>


More information about the guardian-dev mailing list