Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C# Programming › Need help with this source code

Need help with this source code

Posts 1–3 of 3 · Page 1 of 1
VI
vitaminb2
Need help with this source code
Hello I got a problem with the padding after decrytion.

(I dont want to use convert.tobase64string metheod)

So, Ive found this source code, for encrypting and decrypting.

For example:

txtboxNormalString.text = "Hello"

and pressed on encrytion button, txtboxEncrytedString.text = "??:??7s???2?),?" (Hello encrypted)

Then pressed on Decryted button, And txtboxDecrytedString.text = "hello7s???2?),?"

Can somebody explain me how to remove the padding after decryption.

Encryption / decryption is new for me so i dont really know much about it for now.

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;

namespace EncryptionDecryption
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            DesObj = Rijndael.Create();
        }

        string NormalString;
        byte[] CipherBytes;
        byte[] PlainBytes;
        byte[] PlainBytes2;
        byte[] PlainKey;
        SymmetricAlgorithm DesObj;

        private void btnEncrypt_Click(object sender, EventArgs e)
        {
            NormalString = txtboxNormalString.Text;
            PlainBytes = Encoding.ASCII.GetBytes(NormalString);
            PlainKey = Encoding.ASCII.GetBytes("12845726gh3846gs");
            DesObj.Key = PlainKey;
            DesObj.Mode = CipherMode.CBC;
            DesObj.Padding = PaddingMode.PKCS7;
            System****.MemoryStream ms = new System****.MemoryStream();
            CryptoStream cs = new CryptoStream(ms,DesObj.CreateEncryptor(), CryptoStreamMode.Write);
            cs.Write(PlainBytes, 0, PlainBytes.Length);
            cs.Close();
            CipherBytes = ms.ToArray();
            ms.Close();
            txtboxEncryptedString.Text = Encoding.ASCII.GetString(CipherBytes);
        }

        private void btnDecrypt_Click(object sender, EventArgs e)
        {
            System****.MemoryStream ms1 = new System****.MemoryStream(CipherBytes);
            CryptoStream cs1 = new CryptoStream(ms1, DesObj.CreateDecryptor(), CryptoStreamMode.Read);
            cs1.Read(CipherBytes, 0, CipherBytes.Length);
            PlainBytes2 = ms1.ToArray();
            cs1.Close();
            ms1.Close();
            txtboxDecryptedString.Text = Encoding.ASCII.GetString(PlainBytes2);
        }
#1 · 12y ago
WI
willy14
Might be a problem with the brackets
#2 · 12y ago
ZE
ZER0MEM0RY
Are you sure you're typing everything in ASCII? problem might be unicode characters, since C# project is by default in unicode.
#3 · 11y ago
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

  • Hello! i need help with the source code.By LatinHacker in Combat Arms Help
    3Last post 16y ago
  • I need help with thisBy panochito in DayZ Help & Requests
    0Last post 13y ago
  • Need help with a source codeBy G4M3RX in C++/C Programming
    9Last post 15y ago
  • I need help with this code in C#By trevor206 in Programming Tutorial Requests
    0Last post 17y ago
  • Need help with this error...By Screenlooker in Combat Arms Hacks & Cheats
    6Last post 17y ago

Tags for this Thread

#c# code#help#help needed#help with c##need help#need help c##source code