# String Encryption

**URL:** <https://forums.powershell.org/t/string-encryption/16321>\
**Category:** PowerShell Help\
**Created:** [April 23, 2021, 11:17pm UTC](https://forums.powershell.org/t/string-encryption/16321 "2021-04-23T23:17:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ibehere](https://avatars.discourse-cdn.com/v4/letter/i/7c8e57/32.png) [@ibehere](https://forums.powershell.org/u/ibehere)\
**Post date:** [April 23, 2021, 11:17pm UTC](https://forums.powershell.org/t/string-encryption/16321/1 "2021-04-23T23:17:23Z")

</div>

Hello,

So im trying to write a function that takes a ‘Master Password’ and from this password and another string generate a secondary password. The secondary password must be able to be created the same every time using the master and the provided secondary string.

Example:

Master: Welcome4321@  
Secondary key: 451  
Secondary Password: Some algorithm generated password using the previous values.

I though if I encrypted the master with a byte key then tried to decrypt it with a different key from the secondary it would generate a unique string but powershell doesnt like that.

Thanks,  
Ernst.

---

<div class="post-metadata">

**Author:** ![kvprasoon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kvprasoon/32/4449_2.png) [@kvprasoon](https://forums.powershell.org/u/kvprasoon)\
**Post date:** [April 24, 2021, 5:38am UTC](https://forums.powershell.org/t/string-encryption/16321/2 "2021-04-24T05:38:14Z")

</div>

Great.

Can you share the code you have so far trying to do this. it will help anyone here to easily help you out by avoiding any confusions :-).

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:26pm UTC](https://forums.powershell.org/t/string-encryption/16321/3 "2024-05-16T20:26:32Z")

</div>

Closed on May 16, 2024, 8:26pm UTC


