[aerogear-dev] AeroGear Android Crypto / DataManager EncrypetedSQLStore Proposal

Daniel Passos daniel at passos.me
Fri Nov 8 09:04:22 EST 2013


Proposal

My idea/proposal to make EncryptedSQLStore is create 2 tables to store Encrypted. One for Data and other to something we have store to decrypt later

My idea/proposal for creating EncryptedSQLStore is to use two tables: one for ciphertext and other for metadata needed for decryption.

2 Tables

1) SameOfTheModelNameENCRYPTHELPER

ID (Text)  
DATA (BLOB)  

INSERT INTO SameOfTheModelName_ENCRYPT_HELPER (ID, DATA) VALUES ('IV', IV_BYTE[]);
INSERT INTO SameOfTheModelName_ENCRYPT_HELPER (ID, DATA) VALUES ('SALT', SALT_BYTE[]);
2) SameOfTheModelName

ID (Text)  
DATA (BLOB)  

Encryption Process

Get Entity Instance, Parse it to JSON, Encrypt that and Store 

Android Implementation

public void onCreate(SQLiteDatabase sqLiteDatabase) {
        // Create SameOfTheModelName_ENCRYPT_HELPER Table
        // Store IV
        // Store Salt
        // Create SameOfTheModelName Table
}

public void onOpen(SQLiteDatabase db) {
        // TODO This process will be moved to KeyServices http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-Android-Crypto-API-sample-td5306.html
        // Retrive IV from table
        // Retrive Salt from table
        // Create/Recreate PrivateKey
        // Create CryptoUtils/Cryptobox
}
--  Daniel Passos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20131108/6b121067/attachment-0001.html 


More information about the aerogear-dev mailing list