# Is there any way to store passwords in encrypted format in global variables?

**URL:** <https://forum.katalon.com/t/is-there-any-way-to-store-passwords-in-encrypted-format-in-global-variables/12112>\
**Category:** Miscellaneous\
**Created:** [July 18, 2018, 9:51am UTC](https://forum.katalon.com/t/is-there-any-way-to-store-passwords-in-encrypted-format-in-global-variables/12112 "2018-07-18T09:51:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zeeshan\_Shaikh](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zeeshan_shaikh/32/3904_2.png) [@Zeeshan\_Shaikh](https://forum.katalon.com/u/Zeeshan_Shaikh)\
**Post date:** [July 18, 2018, 9:51am UTC](https://forum.katalon.com/t/is-there-any-way-to-store-passwords-in-encrypted-format-in-global-variables/12112/1 "2018-07-18T09:51:43Z")

</div>

Currently, I can see only string type which can be used to store values in global variables. I want to store the password but in an encrypted format (same as what we get in the test case)

How to do that? any suggestions?

---

<div class="post-metadata">

**Author:** ![Andrej\_Podhajsky](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/andrej_podhajsky/32/1055_2.png) [@Andrej\_Podhajsky](https://forum.katalon.com/u/Andrej_Podhajsky)\
**Post date:** [July 18, 2018, 11:18am UTC](https://forum.katalon.com/t/is-there-any-way-to-store-passwords-in-encrypted-format-in-global-variables/12112/2 "2018-07-18T11:18:25Z")

</div>

> **[store passwords in scripts](http://forum.katalon.com/discussion/7910/store-passwords-in-scripts)**
>
> Problem: for reasons behind scope of this document, i need to use passwords in scripts/custom keywords directly.

  
with this you can store anything encrypted anywhere where you can store string

---

<div class="post-metadata">

**Author:** ![Zeeshan\_Shaikh](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zeeshan_shaikh/32/3904_2.png) [@Zeeshan\_Shaikh](https://forum.katalon.com/u/Zeeshan_Shaikh)\
**Post date:** [July 23, 2018, 1:09pm UTC](https://forum.katalon.com/t/is-there-any-way-to-store-passwords-in-encrypted-format-in-global-variables/12112/3 "2018-07-23T13:09:41Z")

</div>

Well, I got my answer myself.

Step 1: Goto Help (in the toolbar) \>\> Encrypt text  
Step 2: Enter the actual password (or any text you want to encrypt)  
Step 3: Copy the encrypted password text  
Step 4: Paste the encrypted text in the global variable and save it.  
Step 4: In the script use the encrypted text using the **setEncryptedText** method on \*\*WebUI  
\*\*

```auto
WebUI.setEncryptedText(findTestObject('TestObjectPath'), GlobalVariable.password)

```

---

<div class="post-metadata">

**Author:** ![Evan](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@Evan](https://forum.katalon.com/u/Evan)\
**Post date:** [September 10, 2018, 4:08am UTC](https://forum.katalon.com/t/is-there-any-way-to-store-passwords-in-encrypted-format-in-global-variables/12112/4 "2018-09-10T04:08:33Z")

</div>

Does this work only for the local profile? What if multiple users are working on the same project? Will these details be stored in a shared source control repo (e.g. git)?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [September 10, 2018, 4:59am UTC](https://forum.katalon.com/t/is-there-any-way-to-store-passwords-in-encrypted-format-in-global-variables/12112/5 "2018-09-10T04:59:23Z")

</div>

> Will these details be stored in a shared source control repo (e.g. git)?

Yes.

> Step 4: Paste the encrypted text in the global variable and save it.

This action will be recorded as a part of the Katalon project (/Profiles/default.glbl) which will be stored in the Git repository.
