C# Tutorial – Encrypt and Decrypt a String | FoxLearn


How to Encrypt and Decrypt a String in C#. The C# Basics beginner course is a free C# Tutorial Series that helps beginning programmers learn the basics of the C# Programming Language. This is the best way to Learn C# for beginners

Encrypt your passwords with MD5 hashing in C#
C# Salting & Hashing Passwords
C# encrypting and decrypting using AES CBC, safe storing the encrypted data
visual C# Adding AES encryption to C# application Forms Application
encryption encrypt- decrypt with AES using C# Forms Application
Advanced Encryption Standard Rijndael cipher Forms Application
C# – Simple AES encryption using Visual C# cryptographic
encrypt my 128 bit string using AES encryption cryptography C#



  1. Hi Sir When i Build App Show This Error

    Severity Code Description Project File Line Suppression State

    Error CS1503 Argument 1: cannot convert from 'System.Windows.Forms.TextBox' to 'char[]' EncrypDecrypt c:userssaleh kakardocumentsvisual studio 2015ProjectsEncrypDecryptEncrypDecryptForm1.cs 25 Active

    Sir Please Send Me Code on My Email:sissoftss@gmail.com

    Thank You Sir i waiting for Answer

  2. Hello fox kearn, please make a video on, how to access data online one place to another place using desktop appkication. Thanx

  3. Here's a complete project made by myself for encrypting and decrypting strings and files, using C# and .NET Standard/Core:


    Main repository:

    I wish it can help.

  4. row 29 & 44 ChipherMode.ECB is a weakness and not recomended according to the Visual Studio description.
    Because it cuts up the text into blocks and encrypts each block individually (instead of mixing in parts from other blocks) if 2 blocks are the same it will be the same encryption (if I have understood it correctly), which enables a lot of ways to break it.
    The other options are:
    CBC (Cipher Block Chaining)
    CFB (Cipher FeedBack)
    CTS (Cipher Text Stealing)
    ECB ( bad Electronic Codebook)
    OFB (Output FeedBack)

  5. please send source code in my email kinchyray@yahoo.com
    I have an error Bad Data in Descrypt
    from byte[] result = transform.TransformFinalBlock(data, 0, data.Length);


Please enter your comment!
Please enter your name here