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++/C Programming › Simple Text Encryption

Simple Text Encryption

Posts 1–9 of 9 · Page 1 of 1
DE
Defcon 1
Simple Text Encryption
Not sure why but I had a sudden urge to share this... It is my way of encrypting text thru vectors
Code:
/*
*	Author: Defcon Noob :)
*	July 20, 2011
*/

#include <iostream>
#include <Windows.h>
#include <string>
#include <time.h>
#include <vector>
#include <math.h>
#include <stdio.h>


using namespace std;
int random;
void encrypt( string &m, vector<int> &e); 
void decrypt( string &m, vector<int> &e);

int input;

int main( )
{
	string m;
	vector<int> e;
	int choice;
	int i=0;
		cout << "Input string: " << endl;
		getline(cin, m);
		while(1){
			cout << " " << endl;
			cout << "Enter 0 for encrypt, 1 for decrypt." << endl;
			cout << " " << endl;
			Sleep(500);
			cin >> choice;
			if (choice)
			{
				input=45;
				decrypt(m, e);
			}
			else
			{
				input=45;
				encrypt(m, e);
			}
			Sleep(5000);
		}
	system("pause");
	return 0;
}
void encrypt (string &m, vector<int> &e) 
{
	int size;
	size = m.size();
	for(int i=0; i < size; i++)
	{
		e.push_back((unsigned char)m[i] * input);
		m[i] = ' ';
	}
	cout << " " << endl;
	cout << "Encrypted string is: ";
	cout << " " << endl;
	for (int i = 0; i < e.size(); i++)
		cout << e[i];
	cout << endl;
}
void decrypt(string &m, vector<int> &e) 
{
	int size;
	size = m.size();
	for(int i=0; i < size; i++){
		m[i] = (unsigned char)(e[i] / input );
	}
	cout << " " << endl;
	cout << "Decrypted string is: " << m << endl;
	cout << " " << endl;
	
}
#1 · 14y ago
25
258456
Good job. If you really like encryption you should look up tutorials on Wincrypt.h
#2 · 14y ago
radnomguywfq3
radnomguywfq3
Speaking technically, this is encoding not encrypting; there is a fine difference between the two that are typically mixed.

Encrypting will usually involve a key which is used while encrypting or decrypting data; this key defines the particular mathematical process used when recovering or obstructing the data. Where as encoding usually follows the same protocol when transforming all the data into another form (in this case, it just divides all the data by x, and recovers via multiplication.)

A simple & commonly first introduced example of encryption is XOR encryption. Which invovles performing an XOR operation between the key and the data. Notice that in this form of encryption, the output of the data is dependant on the key (Which it is XORed with)
#3 · 14y ago
DE
Defcon 1
Quote Originally Posted by Jetamay View Post
Speaking technically, this is encoding not encrypting; there is a fine difference between the two that are typically mixed.

Encrypting will usually involve a key which is used while encrypting or decrypting data; this key defines the particular mathematical process used when recovering or obstructing the data. Where as encoding usually follows the same protocol when transforming all the data into another form (in this case, it just divides all the data by x, and recovers via multiplication.)

A simple & commonly first introduced example of encryption is XOR encryption. Which invovles performing an XOR operation between the key and the data. Notice that in this form of encryption, the output of the data is dependant on the key (Which it is XORed with)
Oh ok .
#4 · 14y ago
♪~ ᕕ(ᐛ)ᕗ
♪~ ᕕ(ᐛ)ᕗ
Quote Originally Posted by Jetamay View Post
Speaking technically, this is encoding not encrypting; there is a fine difference between the two that are typically mixed.

Encrypting will usually involve a key which is used while encrypting or decrypting data; this key defines the particular mathematical process used when recovering or obstructing the data. Where as encoding usually follows the same protocol when transforming all the data into another form (in this case, it just divides all the data by x, and recovers via multiplication.)

A simple & commonly first introduced example of encryption is XOR encryption. Which invovles performing an XOR operation between the key and the data. Notice that in this form of encryption, the output of the data is dependant on the key (Which it is XORed with)
I Love You!
#5 · 14y ago
Saltine
Saltine

Leeched.
#6 · 14y ago
Hassan
Hassan
Leeched.
/Closed.
#7 · 14y ago
Hassan
Hassan
Apparently this is not leeched as the proof has been provided:





Re-opened.
#8 · 14y ago
DE
Defcon 1
Lol it's all good welp my new account/start over has been blown out of the water GG
#9 · 14y ago
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

  • [VB][Release] Text EncrypterBy CoderNever in Visual Basic Programming
    2Last post 16y ago
  • How to make a simple text based game in c++By VvITylerIvV in Programming Tutorials
    13Last post 16y ago
  • Flameswor10's Simple/Step Encryption MethodsBy flameswor10 in Combat Arms Hack Coding / Programming / Source Code
    22Last post 14y ago
  • New modder Need help with simple text input NOOB!!By rotceh_dnih in Call of Duty Black Ops GSC Modding Help & Discussion
    3Last post 15y ago
  • My simple Text Based RPG!By VvITylerIvV in C++/C Programming
    6Last post 15y ago

Tags for this Thread

None