Skip to content

ThirteeNov

My personal blog about coding and internet

Menu
  • About me
  • About Zofia Kreasi
  • Cart
  • Checkout
  • Making an airplane game from scratch in Unity
  • My account
  • Privacy Policy
  • Privacy Policy – zkLeaderboard
  • Sample Page
  • Shop
  • Tutorials on Learning JavaScript
  • ZKAccounts – Privacy Policy
Menu

Another Simple JavaScript Encryption

Posted on March 25, 2018August 4, 2020 by Habibie

Somebody asked me how to do an encryption just like if we type “a” it should return “d” (3 letters after “a” position).

I can give a kind of clue, but it needs improvements though.

Check out this source code:

<!DOCTYPE html>
<html>
	<head>
		<title>ZK Tutorials</title>
	</head>
	<body>
		<h1>Another Simple JavaScript Encryption</h1>
		<input id="originaltext"><br>
		<button onclick="encrypt()">Encrypt</button>
		<p id="er">Encryption Result</p>
		<script>
			var letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
			
			function encrypt(){
				var originalText = document.getElementById("originaltext").value;
				var tempVar = "";
				for(var i = 0; i < originalText.length; i++){
					for(var z = 0; z < letters.length; z++){
						if(originalText[i] == letters[z]){
							tempVar += letters[z+3];
						}
					}
				}
				document.getElementById("er").innerHTML = tempVar;
			}
		</script>
	</body>
</html>

See how it works in this video:

Post Views: 390
ciihuy2020

Welcome!

  • My YouTube Channel
  • My GitHub Page
  • About me

Categories

  • 3DVista
  • Android
  • Apache
  • C#
  • Cordova
  • Electron & Node JS
  • HTML5, CSS & JavaScript
  • iOS
  • Let's Make Unity Games
  • Misc
  • Photoshop
  • PHP
  • Python
  • Uncategorized
  • Unity
  • WordPress

Recent Posts

  • Hover Reveal script for Unity to show and hide object on mouse hover
  • How to Prevent UI Clicks in Unity from “Bleeding Through” to 3D Objects Behind Them
  • Make objects like wires and cables easily in Unity using Ciihuy Curved Mesh
  • [SOLVED] Can’t Add Custom Domain to Blogger After Losing CNAME Verification
  • iOS App Icon Generator by CiihuyCom
© 2026 ThirteeNov | Powered by Superbs Personal Blog theme