Click here to Skip to main content
16,010,544 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting this simple crypto function to work in c#? Pin
stephen.darling10-Aug-11 3:57
stephen.darling10-Aug-11 3:57 
GeneralRe: Getting this simple crypto function to work in c#? Pin
BobJanova10-Aug-11 4:00
BobJanova10-Aug-11 4:00 
GeneralRe: Getting this simple crypto function to work in c#? Pin
stephen.darling10-Aug-11 4:08
stephen.darling10-Aug-11 4:08 
GeneralRe: Getting this simple crypto function to work in c#? Pin
MicroVirus10-Aug-11 4:27
MicroVirus10-Aug-11 4:27 
AnswerRe: Getting this simple crypto function to work in c#? Pin
OriginalGriff9-Aug-11 21:39
mveOriginalGriff9-Aug-11 21:39 
GeneralRe: Getting this simple crypto function to work in c#? Pin
stephen.darling10-Aug-11 4:04
stephen.darling10-Aug-11 4:04 
GeneralRe: Getting this simple crypto function to work in c#? Pin
OriginalGriff10-Aug-11 4:21
mveOriginalGriff10-Aug-11 4:21 
AnswerRe: Getting this simple crypto function to work in c#? Pin
BobJanova9-Aug-11 23:18
BobJanova9-Aug-11 23:18 
I think you got the KeyedHash translation already (it is just the first 8 bytes of a SHA1 hash).

void DecryptInstID(byte[]InstID)
{
	int length = InstID.Length;
	if(0 != length % 2) throw new ArgumentException("Must be even length");
	length >>= 1;
	
	byte[] Aux = new byte[length];

	int i, k;
 
	Left = InstID;
	Right = InstID + 8;
 
	for (i = 0; i < 4; i++)
	{
		KeyedHash(InstID, Aux, length);
 
		for (k = 0; k < 8; k++)
			Aux[k] ^= InstID[k + length];
			
		CopyBytes(InstID, InstID, length, 0, length);
		CopyBytes(InstID, Aux, 0, 0, 8);
	}
}

void CopyBytes(byte[] target, byte[] source, int targetIndex, int sourceIndex, int length){
	for(int i = 0; i < length; i++) target[i+targetIndex] = source[i+sourceIndex];
}


Something like that, anyway.
GeneralRe: Getting this simple crypto function to work in c#? Pin
stephen.darling10-Aug-11 4:19
stephen.darling10-Aug-11 4:19 
GeneralRe: Getting this simple crypto function to work in c#? Pin
BobJanova10-Aug-11 8:22
BobJanova10-Aug-11 8:22 
GeneralRe: Getting this simple crypto function to work in c#? Pin
stephen.darling11-Aug-11 4:25
stephen.darling11-Aug-11 4:25 
QuestionGet div values Pin
Herboren9-Aug-11 9:40
Herboren9-Aug-11 9:40 
AnswerRe: Get div values Pin
BobJanova9-Aug-11 23:05
BobJanova9-Aug-11 23:05 
QuestionResetting a user control using the same instance Pin
MAW309-Aug-11 9:27
MAW309-Aug-11 9:27 
AnswerRe: Resetting a user control using the same instance Pin
BillWoodruff9-Aug-11 9:58
professionalBillWoodruff9-Aug-11 9:58 
GeneralRe: Resetting a user control using the same instance Pin
MAW309-Aug-11 10:35
MAW309-Aug-11 10:35 
AnswerRe: Resetting a user control using the same instance Pin
MicroVirus9-Aug-11 12:37
MicroVirus9-Aug-11 12:37 
GeneralRe: Resetting a user control using the same instance Pin
MAW309-Aug-11 13:13
MAW309-Aug-11 13:13 
GeneralRe: Resetting a user control using the same instance Pin
BillWoodruff9-Aug-11 14:54
professionalBillWoodruff9-Aug-11 14:54 
GeneralRe: Resetting a user control using the same instance Pin
MicroVirus10-Aug-11 3:15
MicroVirus10-Aug-11 3:15 
QuestionVisio Interop and C# Pin
USAFHokie809-Aug-11 7:53
USAFHokie809-Aug-11 7:53 
QuestionAdvice on building charts C#, ASP, etc. Pin
MAW309-Aug-11 7:31
MAW309-Aug-11 7:31 
AnswerRe: Advice on building charts C#, ASP, etc. Pin
Abhinav S9-Aug-11 7:39
Abhinav S9-Aug-11 7:39 
QuestionVS2010 "Unable to copy file..." With Custom Controls Pin
Matt U.9-Aug-11 7:26
Matt U.9-Aug-11 7:26 
AnswerRe: VS2010 "Unable to copy file..." With Custom Controls Pin
BillWoodruff9-Aug-11 8:44
professionalBillWoodruff9-Aug-11 8:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.