1.0.7 • Published 5 years ago

angular-2-local-storage-encrypt v1.0.7

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

angular-2-local-storage-encrypt

Based on angular-2-local-storage AoT compatible.

Differences

  • Save the values with AES128

Install

npm install crypto-js angular-2-local-storage-encrypt

Usage

You can optionally configure the module:

import { LocalStorageModule } from 'angular-2-local-storage-encrypt';

@NgModule({
    imports: [
        LocalStorageModule.forRoot({
            prefix: 'my-app',
            storageType: 'localStorage',
            encryptionActive: true,
            encryptionOptions: {
                encryptionKey: 'keyForEncriptHere',
                encryptionIv: 'iVHere',
                encryptionSalt: 'saltHere'
            }
        })
    ],
    declarations: [
        ..
    ],
    providers: [
        ..
    ],
    bootstrap: [AppComponent]
})
export class AppModule { }

Then you can use it in a component:

import { LocalStorageServiceEncrypt } from 'angular-2-local-storage-encrypt';

@Component({
    // ...
})
export class SomeComponent {
    constructor (
        private _localStorageService: LocalStorageService
    ) {
        // this._localStorageService.set('key', 'value');
        // this._localStorageService.get('key');
    }
}

Configuration options

encryptionActive: boolean; true for save with AES128, false for text plain;

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago