kvs 0.1.1 copy "kvs: ^0.1.1" to clipboard
kvs: ^0.1.1 copied to clipboard

High performance persistant memory based key-value storage with AES256 encryption. Support all features and can be used as drop-in of Dart Map<K,V>.

High performance persistant memory key-value storage with AES256 encryption.

Features #

  • Persistant storage in document directory or directory provided.
  • Supports encryption on rest.
  • Can be used as Map alternative.

Planned Features #

  • Use IndexedDB instead of localStorage

Usage #

void main() async {
  var localStorage = KVS<String, int>(
    name: 'storeName',
    cipher: AESGCM256(key: 'mySecretKey'),
  );

  await localStorage.init();

  localStorage['year'] = 2023;
  localStorage['year']; // 2023
  localStorage.length; // 1
  localStorage.addAll({
    'month': 1,
    'date': 1,
  });
  localStorage.length; // 3
}

Add encryption to existing storage #

var localStorage = KVS<String, int>(
  name: 'storeName'
);

await localStorage.init();

localStorage.cipher = AESGCM256(key: 'mySecretKey');
localStorage.flush();

Remove encryption from existing storage #

var localStorage = KVS<String, int>(
  name: 'storeName',
  cipher: AESGCM256(key: 'mySecretKey'),
);

await localStorage.init();

localStorage.cipher = null;
localStorage.flush();

Change encryption key of existing storage #

var localStorage = KVS<String, int>(
  name: 'storeName',
  cipher: AESGCM256(key: 'oldSecretKey'),
);

await localStorage.init();

localStorage.cipher = AESGCM256(key: 'newSecretKey');
localStorage.flush();
1
likes
140
pub points
67%
popularity

Publisher

verified publisherensorta.com

High performance persistant memory based key-value storage with AES256 encryption. Support all features and can be used as drop-in of Dart Map<K,V>.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

cryptography, cryptography_flutter, flutter, path_provider

More

Packages that depend on kvs