$h: Links

$h: Hero Section $show=home

Welcome to RANGSEYhome!

RANGSEYhome is a multifaceted site created by Rangsey P. HENG, a Freelancer, B/Vlogger, and Advocate with a passion for discovering life's wisdom. Through his experiences and insights, Rangsey shares his passions and knowledge through writing and multimedia content, helping others live better and more meaningful lives.

This site serves as a personal blog, portfolio, diary, and supportive space, offering a diverse collection of articles.

Learn More
Student reading a book

$h: About Section $show=home

About Me

Greetings from Cambodia! My name is Rangsey HENG, delighted to share my journey of learning, inspiration, and growth alongside you.

Adding value to people's lives is the heart of my mission in life. I am a dedicated learner, empathetic listener, passionate advocate, writer, blogger, vlogger, freelancer, and more. I am deeply in love with exploring life's wisdom, sharing it to make a positive impact, and inspiring others to achieve their full potential.

My goal is to inspire and guide individuals towards living better and more meaningful lives, helping them discover their true selves and unlock their inner potential. I believe that everyone has the capacity to live a life filled with joy, purpose, and fulfillment. Through my work, I aim to provide the tools, resources, and inspiration needed to help people transform their lives and achieve their goals, ultimately leading to a more meaningful and authentic existence.

Read more

$h: Books 2025 $show=home

$h: What People Say! $show=home

$h: Gs Data

JavaScript Encryption and Decryption

SHARE:

JavaScript Encryption and Decryption 2.0 The JavaScript decryption code is developed by Vincent Cheung. Encryption/Decryption ...

JavaScript Encryption and Decryption 2.0

The JavaScript decryption code is developed by Vincent Cheung.

Encryption/Decryption

Key


   

Plain Text


   

Cipher Text


   

HTML Code



Standard       Inline       ***

HTML Test

 

See the instructions for how to use this in your webpage

[next]

JavaScript Encryption and Decryption Features

Encrypt your webpage or blog

  • Keep your information hidden from others, even the government!
  • Put encryption on any webpage
  • Decrypt right in your own webpage
  • There are lots of different ways to use this on your own site

Fast and easy

  • It just takes a little bit of copying and pasting to add encryption to any webpage
  • Decrypting is as simple as clicking a link and entering the password
  • Tested in Internet Explorer, Firefox, Chrome, Safari, Opera and on Windows, Mac OS X, and Linux

Secure

  • The encryption used is 256-bit AES, the standard used by the US Government
  • Unlike regular password protection, everything is done locally in the browser using JavaScript, so your unencrypted information is never on the internet, not even on the server!
  • The encrypted text is safe as long as you keep the key secret. Do not lose the key. If you do, no one can help you!

Free with no catches

  • Completely free with no ads, viruses, spyware, stds, trial periods, or watermarks
  • No backdoors (not even I can break the encryption to read your encrypted information!)
  • Ok, one catch, do not use this if encryption is illegal in your country or if you plan to use this for illegal purposes, and I am not responsible for anything you do with this
[next]

Instructions

To put encrypted text in your own site:
  1. Add the decryption JavaScript code (see below)
  2. Encrypt your text on the encryption page
    1. Type the password for the encrypted text in the Key box (be sure to remember the key!)
    2. Enter whatever you want to encrypt in the Plain Text box
    3. Click Encrypt
  3. Copy and paste the code in the HTML Code box into your website or blog

The JavaScript decryption code

Between the <head> and </head> tags in the html code of your webpage, add the following:

<script type="text/javascript" src="http://www.vincentcheung.ca/jsencryption/jsencryption.js"></script>

Encrypted text and decryption link

This is the basic code to use in the body of the html code of your webpage to do the decryption:

<div id=" uniqueID" title=" encrypted text">
    <a href="javascript:decryptText(' uniqueID')">Show encrypted text</a>
</div>

encrypted text is the encrypted text generated from the encryption/decryption page.

uniqueID is a unique name for the element, which is automatically generated by the encryption/decryption page in the sample code. This can be anything that you want, but do not put your key here because it is visible to everyone.

The decryptText JavaScript function gets the encrypted text from the title of the element with the id uniqueID. Once decrypted, the contents of the element are replaced with the decrypted text.

The two uniqueID's must be exactly the same, otherwise the code will not work.

See the examples page to see this in action and for different uses.

Advanced options

The decryptText function can accept an array of element id's and it will decrypt each of them. The encrypted text in each of these element id's can be encrypted with the same or different keys.

You can change the message in the dialog box that asks for the key by providing the desired message as a second parameter, eg. decryptText('uniqueID', 'Enter the password:')

Instead of the fancy dialog box, you can use the standard JavaScript dialog box to request the key by doing this:
decryptText('uniqueID', null, true) or decryptText('uniqueID', 'Enter the key:', true)

One word of caution is that IE7 blocks the regular JavaScript dialog box and you have to click the pop-up message to allow the dialog to show.

Bookmarklets

Drag these to the bookmark toolbar:
Encrypt
Decrypt

These bookmarklets provide a quick shortcut to the encryption/decryption page and automatically fills in the plain or encrypted text fields with the selected text on the page that you are currently on.

[next]

Examples

The decryption key for the examples below is:  the key

Example 1:  Basic version

Code:

<div id=" uniqueID" title=" encrypted text">
    <a href="javascript:decryptText(' uniqueID')">Show encrypted text</a>
</div>

Plain text:
Hello World!

Example 2:  Hidden image and link

Code:

<div id=" uniqueID" title=" encrypted text">
    <a href="javascript:decryptText(' uniqueID')">Show encrypted info</a>
</div>

Plain text:
<a href="http://www.vincentcheung.ca/jsencryption/"><img src="img/JSEncryptionLogo150.png" /></a><br />
<a href="http://www.vincentcheung.ca/jsencryption/">JavaScript Encryption</a>

Example 3:  Inline text

Reveal

The secret...

Code:

<a href="javascript:decryptText(' uniqueID')">Reveal</a>
<br />
<br />
The secret... <span id=" uniqueID" title=" encrypted text"></span>

Plain text:
has been revealed!

Example 4:  Hidden text

There is *** here

Code:

There is <span id=" uniqueID" title=" encrypted text">
<a href="javascript:decryptText(' uniqueID')">***</a></span> here

Plain text:
hidden text

Example 5:  Hide your email address from spammers

Email address: Show email address (password: the key)

Code:

Email address: <span id=" uniqueID" title=" encrypted text"><a href="javascript:decryptText(' uniqueID', 'Enter password:')">Show email address</a> (password: the key)</span>

Plain text:
<a href="mailto:***">***</a>

Example 6:  Multiple encryptions

Decrypt text

This is cool

Code:

<a href="javascript:decryptText([' uniqueID1', ' uniqueID2'])">Decrypt text</a>
<br />
<br />
This is <span id=" uniqueID1" title=" encrypted text 1"></span>cool<span id=" uniqueID2" title=" encrypted text 2"></span>

Plain text:
<span style="color:red">really</span> and <span style="color:red">!!!</span>

Example 7:  More than 1 key  (the second key is:  the second key)

Decrypt

*** went ***

Code:

<a href="javascript:decryptText([' uniqueID1', ' uniqueID2'], 'Enter one of the decryption keys:')">Decrypt</a>
<br />
<br />
<span id=" uniqueID1" title=" encrypted text 1">***</span> went <span id=" uniqueID2" title=" encrypted text 2">***</span>

Plain text:
"Jack and Jill" (encrypted with one key) and "up the hill" (encrypted with the second key)

Example 8:  Big example  (the second key is:  the second key)

Show encrypted text

Code:

<a href="javascript:decryptText([' uniqueID1', ' uniqueID2'])">Show encrypted text</a>
<br />
<div id=" uniqueID1" title=" encrypted text 1"></div>
<div id=" uniqueID2" title=" encrypted text 2"></div>
<div class="clear"></div>

Plain text:
<div style="float:left; width: 48%">Lots of text</div> (encrypted with one key)
<div style="float:right; width: 48%">Lots more text</div> (encrypted with the second key)

Example 9:  My personal blog

Sometimes I use encryption on my personal blog to keep things hidden from prying eyes. Most of my blog can be viewed by anyone, but every once in a while, I want to write about something that I don't want certain people to read.

I give the key to people that I trust so they can read the encrypted posts. I use several different keys for my posts and different people have different keys.

These are my encrypted blog posts. No, you may not have the key :)

[next]

Disclaimer

Disclaimer: Do not use this if encryption is illegal in your country or if you plan to use this for illegal purposes.

This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

COMMENTS

$0: Reminder

Loaded All Posts Not found any posts VIEW ALL Read more Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Show posts in ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Codes or Texts Select All Codes or Texts All codes or texts were copied to your clipboard Can not copy the codes or texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Contents