{ "id": "131592", "key": "AC-877", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2014-06-24T21:51:34.000+0000", "created": "2014-06-11T14:09:01.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:37:10.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14550", "name": "Appcelerator Modules", "description": "Please enter tickets related to Modules here." }, { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "We have a project that consists of the following components:\r\n\r\n1) Alloy project\r\n2) Photo Module (custom appcelerator module)\r\n3) Transmission Module (custom appcelerator module)\r\n\r\nAll three components need read/write access to the sqlite database.\r\n\r\nWe just converted the alloy project to use the encrypted.database module version 1.0.1 and can no longer access the database from the custom modules.\r\n\r\nWe have integrated sqlcipher into the custom modules and entered the same key, but the decryption in the custom module fails.\r\n\r\nWe would like to know how to configure sqlcipher in the custom modules to be compatible with the Appcelerator encrypted database module\r\n\r\nHere is the output from CODEC_DEBUG when the modules tries to open the encrypted database:\r\n\r\nsqlite3_key entered: db=0xcba8c00 pKey=abc123 nKey=6\r\nsqlite3_key_v2: entered db=0xcba8c00 zDb=main pKey=abc123 nKey=6\r\nsqlite3CodecAttach: entered nDb=0 zKey=abc123, nKey=6\r\nsqlcipher_codec_ctx_set_use_hmac: use=1 block_sz=16 md_size=20 reserve=48\r\nsqlcipher_cipher_ctx_copy: entered target=0xc0cc660, source=0xc0cc540\r\ncodec_set_btree_to_codec_pagesize: sqlite3BtreeSetPageSize() size=1024 reserve=48\r\n\r\nSELECT count(*) from sqlite_master executed here\r\n\r\nsqlite3Codec: entered pgno=1, mode=3, page_sz=1024\r\ncipher_ctx_key_derive: entered c_ctx->pass=abc123, c_ctx->pass_sz=6 ctx->kdf_salt=0xc0cc520 ctx->kdf_salt_sz=16 c_ctx->kdf_iter=64000 ctx->hmac_kdf_salt=0xc0cc530, c_ctx->fast_kdf_iter=2 c_ctx->key_sz=32\r\ncipher_ctx_key_derive: deriving key using full PBKDF2 with 64000 iterations\r\ncipher_ctx_key_derive: deriving hmac key from encryption key using PBKDF2 with 2 iterations\r\nsqlcipher_cipher_ctx_cmp: entered c1=0xc0cc660 c2=0xc0cc540\r\ncipher_ctx_key_derive: entered c_ctx->pass=abc123, c_ctx->pass_sz=6 ctx->kdf_salt=0xc0cc520 ctx->kdf_salt_sz=16 c_ctx->kdf_iter=64000 ctx->hmac_kdf_salt=0xc0cc530, c_ctx->fast_kdf_iter=2 c_ctx->key_sz=32\r\ncipher_ctx_key_derive: deriving key using full PBKDF2 with 64000 iterations\r\ncipher_ctx_key_derive: deriving hmac key from encryption key using PBKDF2 with 2 iterations\r\nsqlite3Codec: switch mode=3 offset=16\r\ncodec_cipher:entered pgno=1, mode=0, size=960\r\ncodec_cipher: comparing hmac on in=0xe389fe0 out=0xcbc07e0 hmac_sz=20\r\ncodec_cipher: hmac check failed for pgno=1 returning SQLITE_ERROR\r\nsqlcipher_codec_ctx_set_error: ctx=0xc0cc4f0, error=1\r\ncodec_ctx_free: entered iCtx=0xbfffcce0\r\ncipher_ctx_free: entered iCtx=0xc0cc508\r\ncipher_ctx_free: entered iCtx=0xc0cc50c\r\n", "attachment": [], "flagged": false, "summary": "Unable to open encrypted database", "creator": { "name": "scott.mason@safeguardproperties.com", "key": "scott.mason@safeguardproperties.com", "displayName": "Scott Mason", "active": true, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "scott.mason@safeguardproperties.com", "key": "scott.mason@safeguardproperties.com", "displayName": "Scott Mason", "active": true, "timeZone": "America/Havana" }, "environment": "OSX 10.9 Xcode 5.1", "comment": { "comments": [ { "id": "310772", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-06-24T21:51:34.000+0000", "updated": "2014-06-24T21:51:34.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }