티스토리 뷰

암호화 알고리즘 

1. 대칭키 알고리즘(Symmetric Encryption) : 암호화 - 복호화 할 때 같은 키값을 이용

2. 비대칭키 알고리즘(Asymmetric Encryption) : 암호화 - 복호화 할 때 다른 키값을 이용 

3. 해싱(hashing) : 단방향으로 암호화만 가능하고 복호화 할 수 없다. 비밀번호 등에 이용. 

알고리즘 종류 비고
대칭키 DES, 3-DES, AES(128bit, 256bit), SEED, ARIA AES가 가장 보편적으로 이용
비대칭키 RSA, ECC, DSS  
해싱 MD5, SHA-0, SHA-1, SHA-2  

 

crytojs는 자바스크립트 기반으로 암/복호화를 제공하는 라이브러리로 쉽고 간단하게 적용 가능하다. 

사이트 : cryptojs.gitbook.io/docs/

 

CryptoJS

Original documentation: https://code.google.com/archive/p/crypto-js/

cryptojs.gitbook.io

cryptojs cdn 링크 : cdnjs.com/libraries/crypto-js

 

crypto-js - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers

JavaScript library of crypto standards. - Simple. Fast. Reliable. Content delivery at its finest. cdnjs is a free and open-source CDN service trusted by over 10% of websites, powered by Cloudflare. We make it faster and easier to load library files on your

cdnjs.com

간단예제  

var CryptoJS = require("crypto-js");
 
var data = [{id: 1}, {id: 2}]
 
// Encrypt
var ciphertext = CryptoJS.AES.encrypt(JSON.stringify(data), 'secret key 123').toString();
 
// Decrypt
var bytes  = CryptoJS.AES.decrypt(ciphertext, 'secret key 123');
var decryptedData = JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
 
console.log(decryptedData); // [{id: 1}, {id: 2}]

출처 : www.npmjs.com/package/crypto-js

 

crypto-js

JavaScript library of crypto standards.

www.npmjs.com

cryptoJs는 브라우저에 간단하게 설치할 수 있으며 누구나 쉽게 적용할 수 있습니다.    

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함