calvinmetcalf / crypto-pouch

plugin for encrypted pouchdb/couchdb databases
MIT License
243 stars 43 forks source link

Crypto-pouch and ionic 2 #23

Closed tubauwe closed 3 years ago

tubauwe commented 8 years ago

In the last few days I tested a little with ionic 2 and got pouchDB working with an app. The next step was, to check, if data encryption with crypto-pouch is possible at the moment:

After the import statements inside my data provider I added crypto-pouch by the following line:

var PouchDB = require('pouchdb').plugin(require('crypto-pouch'));

Inside the constructor of my provider I added:

_db = new PouchDB('exampleDB', { adapter: 'websql'});
if (!_db.adapter) {
  _db = new PouchDB('exampleDB');
  console.log('Adapter: ' + _db.adapter);
 } else {
   console.log('Adapter: websql');
 }

_db.crypto('pa$$w0rd').then(function(){

});

If I add a new document to database the development tools show that it is in the database and it is encrypted, but if I reload my app the data seems not to be decrypted.

Do you have any experience with ionic 2 and crypto-pouch an can you help me to find the problem?

calvinmetcalf commented 8 years ago

The crypto module both encrypts and decrypts your data so you can use it like a regular database but the underlying data is stored in an encrypted manner

On Wed, Mar 16, 2016, 5:15 PM tubauwe notifications@github.com wrote:

In the last few days I tested a little with ionic 2 and got pouchDB working with an app. The next step was, to check, if data encryption with crypto-pouch is possible at the moment:

After the import statements inside my data provider I added crypto-pouch by the following line:

var PouchDB = require('pouchdb').plugin(require('crypto-pouch'));

Inside the constructor of my provider I added:

_db = new PouchDB('exampleDB', { adapter: 'websql'}); if (!_db.adapter) { _db = new PouchDB('exampleDB'); console.log('Adapter: ' + _db.adapter); } else { console.log('Adapter: websql'); }

_db.crypto('pa$$w0rd').then(function(){

});

If I add a new document to database the development tools show that it is in the database and it is encrypted, but if I reload my app the data seems not to be decrypted.

Do you have any experience with ionic 2 and crypto-pouch an can you help me to find the problem?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/calvinmetcalf/crypto-pouch/issues/23

calvinmetcalf commented 8 years ago

Er misread that, as to why it isn't decrypted are you setting the db.crypto both times? Don't have any ionic experience though sorry

On Thu, Mar 17, 2016, 7:18 AM Calvin Metcalf calvin.metcalf@gmail.com wrote:

The crypto module both encrypts and decrypts your data so you can use it like a regular database but the underlying data is stored in an encrypted manner

On Wed, Mar 16, 2016, 5:15 PM tubauwe notifications@github.com wrote:

In the last few days I tested a little with ionic 2 and got pouchDB working with an app. The next step was, to check, if data encryption with crypto-pouch is possible at the moment:

After the import statements inside my data provider I added crypto-pouch by the following line:

var PouchDB = require('pouchdb').plugin(require('crypto-pouch'));

Inside the constructor of my provider I added:

_db = new PouchDB('exampleDB', { adapter: 'websql'}); if (!_db.adapter) { _db = new PouchDB('exampleDB'); console.log('Adapter: ' + _db.adapter); } else { console.log('Adapter: websql'); }

_db.crypto('pa$$w0rd').then(function(){

});

If I add a new document to database the development tools show that it is in the database and it is encrypted, but if I reload my app the data seems not to be decrypted.

Do you have any experience with ionic 2 and crypto-pouch an can you help me to find the problem?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/calvinmetcalf/crypto-pouch/issues/23