HAB Encryption: Encrypt and decrypt a string with a given key

Recommend this page to a friend!
     
  Info   Example   View files Files   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 79 All time: 459 This week: 7Up
Version License JavaScript version Categories
habencrypt 1.0.1GNU General Publi...5Cryptography
Description 

Author

This object can encrypt and decrypt a string with a given key.

It takes a given string and encrypts it by adding the code of the characters in the string with the codes of the key string.

The object can also do the opposite process by reverting to the original string using the same key.

Picture of Haseeb Ahmad Basil
  Performance   Level  
Name: Haseeb Ahmad Basil <contact>
Classes: 2 packages by
Country: Pakistan Pakistan
Age: 26
All time rank: 1492 in Pakistan Pakistan
Week rank: 6 Up1 in Pakistan Pakistan Up

Recommendations

Example

<html> <head> <script src="habEncrypt.js" type="text/javascript"></script> <script type="text/javascript"> var has = new habEncrypt(); </script> </head> <body> <div id="example"></div> <script type="text/javascript"> var exmpl = document.getElementById('example'); var string = 'Lorem Ipsum doller Sit'; var key = "123456789"; var enc = has.enc(string, key); var dec = has.dec(enc, key); exmpl.innerHTML += "Integer only Key. encrypted Value: " + enc + ". Original and decrypted Value: "+ dec + "</br>"; key = "abc123def456"; enc = has.enc(string, key); dec = has.dec(enc, key); exmpl.innerHTML += "String Key. encrypted Value: " + enc + ". Original and decrypted Value: " + dec + "</br>"; key = "123456789"; enc = has.b64enc(string, key); dec = has.b64dec(enc, key); exmpl.innerHTML += "Integer only Key(Base64 Version). encrypted Value: " + enc + ". Original and decrypted Value: " + dec + "</br>"; key = "abc123def456"; enc = has.b64enc(string, key); dec = has.b64dec(enc, key); exmpl.innerHTML += "String Key(Base64 Version). encrypted Value: " + enc + ". Original and decrypted Value: " + dec; </script> </body> </html> <?php

  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file example.html Example Documentation
Plain text file habEncrypt.js Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:79
This week:0
All time:459
This week:7Up