# Cryptography in PowerShell

**URL:** <https://forums.powershell.org/t/cryptography-in-powershell/7774>\
**Category:** PowerShell Help\
**Created:** [December 31, 2016, 7:42am UTC](https://forums.powershell.org/t/cryptography-in-powershell/7774 "2016-12-31T07:42:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![karemali](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@karemali](https://forums.powershell.org/u/karemali)\
**Post date:** [December 31, 2016, 7:42am UTC](https://forums.powershell.org/t/cryptography-in-powershell/7774/1 "2016-12-31T07:42:38Z")

</div>

I Am good at Cryptography but Not good at using The .net library of crypto

i searched alot online but every thing is related to C# not Powershell , and event what’s about C# is Just a Code

There is No Explaination of what they are doing

i can’t get the concept of encryptor and decryptor they creat in thier codes

There in no thing called encryptor and decryptor in the cipher

i understand the padding ,Mode ,IV ,Salt and every cryptographic concept but can’t dealing with the library

so if any one here have a book or tut. so i can learn what is going on , Please give it to me

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![fredrik-kacsmarck](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@fredrik-kacsmarck](https://forums.powershell.org/u/fredrik-kacsmarck)\
**Post date:** [December 31, 2016, 9:23am UTC](https://forums.powershell.org/t/cryptography-in-powershell/7774/2 "2016-12-31T09:23:24Z")

</div>

It’s probably easier if you describe or link to something you want to use.  
Can’t say I’m good with cryptography but using .net libraries is somewhat similar between powershell and C#.  
Main difference is often the way you instanciate objects and calling the methods.  
If it’s a third party library (meaning not included in the standard .net framework) you also have to add a reference to the library.

But please provide some more information.

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [December 31, 2016, 10:06am UTC](https://forums.powershell.org/t/cryptography-in-powershell/7774/3 "2016-12-31T10:06:07Z")

</div>

You’re going to have to find something in C# that works for you, and translate it to PowerShell. PowerShell doesn’t have any real crypto wrappers, so you’re going to bee using C#, essentially, inside PowerShell.

---

<div class="post-metadata">

**Author:** ![karemali](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@karemali](https://forums.powershell.org/u/karemali)\
**Post date:** [December 31, 2016, 1:49pm UTC](https://forums.powershell.org/t/cryptography-in-powershell/7774/4 "2016-12-31T13:49:58Z")

</div>

Thanks alot , but do you have a book for crypto in C#

---

<div class="post-metadata">

**Author:** ![karemali](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@karemali](https://forums.powershell.org/u/karemali)\
**Post date:** [December 31, 2016, 1:52pm UTC](https://forums.powershell.org/t/cryptography-in-powershell/7774/5 "2016-12-31T13:52:21Z")

</div>

Thanks alot , but can you give me a book or tut to learn crypto in C#

and i didn’t get what do you mean by use C# inside powrshell

---

<div class="post-metadata">

**Author:** ![fredrik-kacsmarck](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@fredrik-kacsmarck](https://forums.powershell.org/u/fredrik-kacsmarck)\
**Post date:** [January 2, 2017, 12:41pm UTC](https://forums.powershell.org/t/cryptography-in-powershell/7774/6 "2017-01-02T12:41:51Z")

</div>

No I don’t have a book or guide, sorry.  
But I’m pretty sure if you google around you should find plenty of examples.

Here is an example for using AES in powershell.

> <https://gist.github.com/ctigeek/2a56648b923d198a6e60>

As a base to explore further it should get you going.  
I guess you may want to include code that will hash the key using a passphrase rather than having just the key if you’re going to store it somewhere.  
But again it shouldn’t be a big deal after some google exercises.

---

<div class="post-metadata">

**Author:** ![karemali](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@karemali](https://forums.powershell.org/u/karemali)\
**Post date:** [January 3, 2017, 3:25am UTC](https://forums.powershell.org/t/cryptography-in-powershell/7774/7 "2017-01-03T03:25:20Z")

</div>

Thank you so Much

---

<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:39pm UTC](https://forums.powershell.org/t/cryptography-in-powershell/7774/8 "2024-05-16T20:39:40Z")

</div>

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


