[js] 초간단 암호화/복호화 소스..
by The JavaScript Source
<!-- TWO STEPS TO INSTALL ASCII ENCRYPTION:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: David Salsinha (david.salsinha@popsi.pt) -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function Encrypt(theText) {
output = new String;
Temp = new Array();
Temp2 = new Array();
TextSize = theText.length;
for (i = 0; i < TextSize; i++) {
rnd = Math.round(Math.random() * 122) + 68;
Temp[i] = theText.charCodeAt(i) + rnd;
Temp2[i] = rnd;
}
for (i = 0; i < TextSize; i++) {
output += String.fromCharCode(Temp[i], Temp2[i]);
}
return output;
}
function unEncrypt(theText) {
output = new String;
Temp = new Array();
Temp2 = new Array();
TextSize = theText.length;
for (i = 0; i < TextSize; i++) {
Temp[i] = theText.charCodeAt(i);
Temp2[i] = theText.charCodeAt(i + 1);
}
for (i = 0; i < TextSize; i = i+2) {
output += String.fromCharCode(Temp[i] - Temp2[i]);
}
return output;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form name=encform onsubmit="return false;">
<textarea name=box1 rows=5 cols=50>The quick brown fox jumps over the lazy dog</textarea>
<p>
<input type=button value="Encrypt Box1 to Box2" onClick="this.form.box2.value=Encrypt(this.form.box1.value);">
<p>
<textarea name=box2 rows=5 cols=50></textarea>
<p>
<input type=button value="Decrypt Box2 to Box3" onClick="this.form.box3.value=unEncrypt(this.form.box2.value);">
<p>
<textarea name=box3 rows=5 cols=50></textarea>
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.83 KB -->
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
685 | Develop | [ios] Xcode를 사용해서 Static Library 만들기 (시뮬레이터 + 디바이스) | hooni | 2015.01.03 | 3403 |
684 | Develop | [ios] Thread Loop 내에서 UI 업데이트 방법 | hooni | 2015.01.03 | 925 |
683 | Develop | [ios] UIView 계층구조 | hooni | 2015.01.03 | 1227 |
682 | Develop | [ios] UIWebView를 이용한 로컬 HTML 파일 표시 | hooni | 2015.01.02 | 1344 |
681 | Develop | [android] 안드로이드 동영상 스트리밍 예제 2 | hooni | 2015.01.02 | 4924 |
680 | Develop | [java] netty (비동기 이벤트 방식 네트워크 프레임워크) 사용법 #2 (client) | hooni | 2015.01.02 | 2132 |
679 | Develop | [java] netty (비동기 이벤트 방식 네트워크 프레임워크) 사용법 #1 (server) 1 | hooni | 2015.01.02 | 2323 |
678 | Develop | ZBar 라이브러리를 이용한 바코드 스캔 앱 개발하기 | hooni | 2015.01.01 | 1729 |
677 | Develop | [ios] 비동기 블럭 코드 예제 | hooni | 2014.11.21 | 904 |
676 | Develop | [ios] 스크린 캡쳐 (전원버튼 + 홈버튼) 호출 알아내기 | hooni | 2014.11.19 | 1658 |
675 | Develop | [android] 가속도 센서를 이용한 흔듦(Shake) 감지 | hooni | 2014.11.04 | 2009 |
674 | Develop | [web] 더 빠른 웹을 위한 프로토콜, 'HTTP/2' | hooni | 2014.10.20 | 1767 |