---
title: "encode the password by javascript"  
description: "encode the password by javascript"  
author: "Varun Agrawal"  
published: 2011-03-29  
updated: 2011-03-29  
canonical: https://www.mindstick.com/forum/207/encode-the-password-by-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# encode the password by javascript

How to [encode and decode](https://www.mindstick.com/forum/159053/how-do-i-encode-and-decode-a-base64-string-in-c-sharp) the [password](https://www.mindstick.com/blog/118/retriving-user-password-by-using-stored-procedure-in-asp-dot-net) by javascript. \
please give the syntax of this problem.

## Replies

### Reply by Amit Singh

hello varun,\
In javascript, we [encode](https://www.mindstick.com/blog/51/encode-and-decode-in-dot-net) the password or any string by using the escape() method and decrypt the string by used unescape() methods.\
\
**for example**\

```
<script type="text/javascript">  var strValue = "this is the new password"; var strvalue1=document.writeln(escape(strValue)); document.write(unescape(strvalue1));</script>
```


---

Original Source: https://www.mindstick.com/forum/207/encode-the-password-by-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
