angular-crypto
Version:
angular-crypto provides standard and secure cryptographic algorithms for Angular.js with support for: MD5, SHA-1, SHA-256, RC4, Rabbit, AES, DES, PBKDF2, HMAC, OFB, CFB, CTR, CBC, Base64
67 lines (60 loc) • 1.97 kB
HTML
<html>
<head>
<title>Example Angular Crypto App</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.3/normalize.min.css">
</head>
<body ng-app="CryptoApp" style="500px auto">
<h1>Angular Crypto App</h1>
<section>
<form ng-submit="">
<h2>Encrypt</h2>
<select ng-model="encrypt.type" ng-change="transform()">
<option value="md5">md5</option>
<option value="base64">base64</option>
</select>
<input ng-model="encrypt.input" placeholder="encryption"/>
<button>Encrypt</button>
<span ng-show="encrypt.input" ng-bind="encrypt.output"></span>
</form>
</section>
<section>
<h2>Decrypt</h2>
<form ng-submit="">
<select ng-model="decrypt.type">
<option value="md5">md5</option>
<option value="base64">base64</option>
</select>
<input ng-model="decrypt.input" placeholder="encryption"/>
<button>Decrypt</button>
<span ng-show="decrypt.input" ng-bind="decrypt.output"></span>
</form>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular-animate.js"></script>
<script src="../angular-crypto.js"></script>
<script>
angular.module('CryptoApp', [
'ngAnimate',
'gdi2290.crypto' // you can also use 'ngCrypto' or 'angular-crypto'
])
.controller('MainController', function($scope, $crypto) {
$scope.types = $crypto.utils.types;
$scope.trasform = function(type) {
return function() {
}
};
$scope.encrypt = {
type: 'md5'
};
$scope.decrypt = {
type: 'md5'
};
})
</script>
</body>
</html>