GithubHelp home page GithubHelp logo

nvdnkpr / angular-cryptography Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arkan/angular-cryptography

0.0 1.0 0.0 195 KB

Allows you to encrypt/decrypt using AES from CryptoJS. Provides a service which you can inject anywhere in your system. You have to configure the service to setup the KEY before you use it

License: Apache License 2.0

JavaScript 100.00%

angular-cryptography's Introduction

Middleout Angular Cryptography

AngularJS Module that integrate cryptography functionality offers from the crypto-js project. Provides a simple service to encrypt and decrypt using AES.

Dependencies

##Install (bower)

  • bower install angular-cryptography
<script type='text/javascript' src="[bower_components/]cryptojslib/rollups/aes.js"></script>
<script type='text/javascript' src="[bower_components/]angular-cryptography/mdo-angular-cryptography.js"></script>

##Install (manual)

  • download js file
  • download js file
  • added javascript file to your app html file
<script type='text/javascript' src="js/aes.js"></script>
<script type='text/javascript' src="js/mdo-angular-cryptography.js"></script>

##Usage

  • add module dependency ('mdo-angular-cryptography') to angular
var demoApp = angular.module('app', ['services', 'mdo-angular-cryptography']);
  • setup the encryption key in your config
angular.module.('app').config(['$cryptoProvider', function($cryptoProvider){
	$cryptoProvider.setCryptographyKey('ABCD123');
});

Example Service Usage

angular.module('app').controller('ExampleController', ['$scope', '$crypto', function($scope, $crypto) {

	var encrypted = $crypto.encrypt('some plain text data');
	var decrypted = $crypto.decrypt(encrypted);
});

or you can use a custom key everytime

angular.module('app').controller('ExampleController', ['$scope', '$crypto', function($scope, $crypto) {

	var encrypted = $crypto.encrypt('some plain text data', 'some custom key');
	var decrypted = $crypto.decrypt(encrypted, 'some other custom key');
});

That's all !

Issues

License

Middleout Angular Cryptography is released under the Apache License.

angular-cryptography's People

Contributors

andreigabreanu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.