pacscryptography
v1.2.0
Published
```bash for applications that will be using via npm run this command on you front end application if you are having npm npm install git://github.com/visionmedia/express.git ```
Downloads
1
Readme
Installation.
Getting Started
how to build this project when updating algorithm
npm install webpack webpack-cli babel-loader @babel/core @babel/preset-env --save-dev
npx webpack --config webpack.config.js
this will create bundle.js file on dist folder.
bundle.js created from dist folder will be moved to specific project and be injected
note that bundle.js created from dist folder will be moved to specific project and be injected
how to inject bundle.js on javascript, sample code snippet here
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple HTML with JavaScript</title>
</head>
<body>
<header>
<h1>Simple HTML with JavaScript</h1>
</header>
<main>
<section>
<h2>Click the Button</h2>
<p id="demo">Open console for the result.</p>
text To encrypt: <input id="decryptedText" type="text" />
<button id="myButton" onclick="changeText()">Click Me</button>
</section>
</main>
<footer>
<p>© 2023 My Simple Website</p>
</footer>
<script src="bundle.js"></script>
<script>
// open browser console while playing
let pem =
"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtjsH5VUv0mVVJs4o7lND\nmNYMNxUdYD3CNsQj3QXAqKcJM9IwCym24dygT3gFKPPcqdvRoSt8OzpIJk9bMZEH\nE30V9Mjl90gH3f7D3/uRvrZypxgHbUIF4HNv6R6UNY2MTgD6mPbRy5HO8sidxgQa\nLmt+6wSXG5+QVaDwhBWdyV38NiUWpZBjWWX3U7CCDlR5gb3EM3okUu0/AwkuU3Kq\nW0roAqsz9YIFGmn9RRk88PP4XasEj5S+uIOIQ3QtiCYE88l7jnHFQbS604bt90+s\n5VOUFkf5R0xsIGn3kylXMQmMwurOlsozkiAUHbDNXNmdOTFBGhFO9/Stjzzuzj06\nSOxwElFGN7bl1HN7qW4xBaHDap85GrwxRUBJ4tDiTzCUN1vTG7GytM3rLJiuH0OE\na+9/CGiSYRazxpJ3cNyUI52k8jZg2dudZZXjJvcQfpKVMBIKddUR0TihZdoa4RA8\nkKMk2LefaDR1Pg/wKspCEYk9X+1h8ioE6XXvryrUaLNcRd7iiMdCAogKGvqQJDGg\nv0hRy0KoedO9cYmUdB9TJhqyWjKdkDEUAoNFzv5MlGBxceTXf+bl2tgP2fKWD/Zs\n+6WFHjxhYEbzHRAJhrS8wnGdFwcjwOYgin7ven/c5jU5ytPicxeVx+krlG7mXe7B\nmtSgG/H6eYs3XuOjdUZ71+ECAwEAAQ==\n-----END PUBLIC KEY-----\n";
var myObjectInstance = new PACSCryptography(pem);
function changeText() {
const val = document.getElementById('decryptedText').value;
console.log('val',val)
var cipherObject = myObjectInstance.encrypt(val);
console.log(cipherObject)
}
</script>
</body>
</html>
todo
make this automated and installed on npm repo or what.