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 › RSA encrypting and decrypting

PostRSA encrypting and decrypting

Posts 1–5 of 5 · Page 1 of 1
JustWorkHereLUL
JustWorkHereLUL
RSA encrypting and decrypting
Hey! I'm trying to make a function that takes a public key and text to format as parameters, both as strings. I'm trying to log in to steam via post requests and have to pass in the password encrypted with RSA key gotten from steam. I can get the key from steam fine as string but I cannot find a working way to use the key to encrypt the password.
#1 · 7y ago
defaulto
defaulto
I haven't worked yet with RSA. The concept seems to be interesting though. So. After googleing it, I guess, this is what you are looking for:
Code:
public static string Encryption(string strText)
        {
            var publicKey = "<RSAKeyValue><Modulus>21wEnTU+mcD2w0Lfo1Gv4rtcSWsQJQTNa6gio05AOkV/Er9w3Y13Ddo5wGtjJ19402S71HUeN0vbKILLJdRSES5MHSdJPSVrOqdrll/vLXxDxWs/U0UT1c8u6k/Ogx9hTtZxYwoeYqdhDblof3E75d9n2F0Zvf6iTb4cI7j6fMs=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";

            var testData = Encoding.UTF8.GetBytes(strText);

            using (var rsa = new RSACryptoServiceProvider(1024))
            {
                try
                {
                    // client encrypting data with public key issued by server                    
                    rsa.FromXmlString(publicKey.ToString());

                    var encryptedData = rsa.Encrypt(testData, true);

                    var base64Encrypted = Convert.ToBase64String(encryptedData);

                    return base64Encrypted;
                }
                finally
                {
                    rsa.PersistKeyInCsp = false;
                }
            }
        }


Source: https://stackoverflow.com/questions/17128038/c-sharp-rsa-encryption-decryption-with-transmission
#2 · edited 7y ago · 7y ago
JustWorkHereLUL
JustWorkHereLUL
Quote Originally Posted by defaulto View Post
I haven't worked yet with RSA. The concept seems to be interesting though. So. After googleing it, I guess, this is what you are looking for:
Code:
public static string Encryption(string strText)
        {
            var publicKey = "<RSAKeyValue><Modulus>21wEnTU+mcD2w0Lfo1Gv4rtcSWsQJQTNa6gio05AOkV/Er9w3Y13Ddo5wGtjJ19402S71HUeN0vbKILLJdRSES5MHSdJPSVrOqdrll/vLXxDxWs/U0UT1c8u6k/Ogx9hTtZxYwoeYqdhDblof3E75d9n2F0Zvf6iTb4cI7j6fMs=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";

            var testData = Encoding.UTF8.GetBytes(strText);

            using (var rsa = new RSACryptoServiceProvider(1024))
            {
                try
                {
                    // client encrypting data with public key issued by server                    
                    rsa.FromXmlString(publicKey.ToString());

                    var encryptedData = rsa.Encrypt(testData, true);

                    var base64Encrypted = Convert.ToBase64String(encryptedData);

                    return base64Encrypted;
                }
                finally
                {
                    rsa.PersistKeyInCsp = false;
                }
            }
        }


Source: https://stackoverflow.com/questions/17128038/c-sharp-rsa-encryption-decryption-with-transmission
It's giving me some errors:

x64: Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform.
x86: Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'C:\Users\makez\source\repos\RSA\RSA\bin\x86\Relea se\netcoreapp2.1\RSA.dll'. An attempt was made to load a program with an incorrect format.

(In build settings application type is set to console application)
#3 · 7y ago
defaulto
defaulto
Quote Originally Posted by JustWorkHereLUL View Post
It's giving me some errors:

x64: Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform.
x86: Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'C:\Users\makez\source\repos\RSA\RSA\bin\x86\Relea se\netcoreapp2.1\RSA.dll'. An attempt was made to load a program with an incorrect format.

(In build settings application type is set to console application)
Wait I give it a try myself. Will edit this reply when I got it working.
Did you downloaded something extra? It should be already included in the .NET Framework, which can be used by "using System.Security.Cryptography;".
Is NET Core actually the same as the NET Framework?
#4 · 7y ago
JustWorkHereLUL
JustWorkHereLUL
Quote Originally Posted by defaulto View Post
Is NET Core actually the same as the NET Framework?
Ah damn I accidently had made .NET Core console application instead of .NET Framework, works now!
#5 · 7y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • Encrypt Passwords in MySQL to access and decrypt in GUIBy SomeAsianDude in Java
    2Last post 5y ago
  • Encryption and Decryption, errorBy Ryan28 in C# Programming
    3Last post 9y ago
  • Text Encrypter and DecrypterBy rileyjstrickland in Visual Basic Programming
    3Last post 13y ago
  • Script Encrypting and Decrypting ServiceBy ikillindreams in DayZ Selling / Trading / Buying
    1Last post 13y ago
  • Error Elite Encrypt.. and no hacks work.By 48Aces in Combat Arms Help
    4Last post 15y ago

Tags for this Thread

#encryption#rsa#rsa encryption#steam