Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Coding Releases > Coding Snippets
You last visited: Today at 01:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[.Net/MSIL] XOR encryption

Discussion on [.Net/MSIL] XOR encryption within the Coding Snippets forum part of the Coding Releases category.

Reply
 
Old   #1
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
[.Net/MSIL] XOR encryption

Sollte selbsterklärend sein, zwei byte arrays rein, eins raus

Code:
.method public static uint8[] xorit (uint8[] input, uint8[] key) cil managed
{
	.locals init(
		[0] int32 i,
		[1] int32 a,
		[2] int32 b
	)
	
	ldc.i4.0 
	stloc.0 //i = 0
	ldarg.0 
	ldlen  
	ldc.i4.1 
	sub 
	stloc.1 //a = input.length - 1
	ldarg.1
	ldlen
	stloc.2 //b = key.length
	br CHECK
	
	LOOP:
	ldarg.0
	ldloc.0
	ldarg.0
	ldloc.0
	ldelem.u1 //load intput[i] as int32
	ldarg.1
	ldloc.0
	ldloc.2
	rem
	ldelem.u1 //load key[i MOD b] as int32
	xor //intput[i] XOR key[i MOD b]
	stelem.i1 //save in input[i] as uint8
	ldloc.0
	ldc.i4.1
	add
	stloc.0 //i = i + 1

	CHECK:
	ldloc.0 //i
	ldloc.1 //a
	bne.un LOOP // i != a ?
	
	ldarg.0
	ret //return input
}
tolio is offline  
Thanks
2 Users
Old 01/27/2014, 23:49   #2
 
elite*gold: 0
Join Date: Jul 2012
Posts: 284
Received Thanks: 127
Kann man schön mit Mono.Cecil verwenden!
Aber selbsterklärend ist das nur für Fortgeschrittene
3Angle is offline  
Old 01/28/2014, 10:50   #3
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
Quote:
Originally Posted by 3Angle View Post
Kann man schön mit Mono.Cecil verwenden!
Aber selbsterklärend ist das nur für Fortgeschrittene
Habs auch letzten Endes für die verwendung mit mono cecil zusammengebaut
tolio is offline  
Reply


Similar Threads Similar Threads
[.Net/MSIL] uint8/byte - bit rotate
01/21/2014 - Coding Snippets - 0 Replies
Weil .Net mich weder in VB noch C# code kompilieren lässt mit welchem ich Bits in nem Byte Rotieren kann, einfach in msil gebaut und passt. .assembly BitShifter {} .module BitShifter.dll .namespace Converter { .class public auto ansi BitShifter extends System.Object { .method public static uint8 RotateLeft(uint8 'value', uint32 count) cil managed
Inline MSIL in C# and Generic Pointers
08/12/2012 - CO2 Programming - 2 Replies
I thought I'd share this here :) Inline MSIL in C# and Generic Pointers - CodeProject More finished content from the UG, yolo.
Encryption Help
08/02/2012 - .NET Languages - 5 Replies
{NOTE : I Tried to google this first but sorry i did not get to my specific point} In the following few lines i will explain the trick that i am worry about , and an explanation for my exact problem Trick : Past i used to crack a program using fake server response 1- Looping back the connection of the program (client) to my computer 2- Sniffing the Login successful packet from the real server 3- Creating a fake server (listener) that listens for a connection from the client and...
Encryption
07/19/2011 - General Coding - 0 Replies
#deleted



All times are GMT +1. The time now is 01:51.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.