SA-MP Forums Archive
[Include] [INC] Simple Encrypt - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] Simple Encrypt (/showthread.php?tid=151325)



[INC] Simple Encrypt - Janson_GH - 30.05.2010

Hey guys, I saw some simple Crypting stuff so I build a simple Crypting function what is based on the Vigenиre Crypting.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
Z A B C D E F G H I J K L M N O P Q R S T U V W X Y

You just get the position of the letter of the key and the string, multiply it.Thats all.

WARNING: This method is only useable for a key that is not longer then 26 letters.

Code:
public Encrypt(string[],key[])
{
	new str[26],b,c,d[27] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",e;
	for(new i; i<strlen(string); i++)
	{
		for(new k;k<strlen(d);k++)
		{
		  if(string[i]==d[k])
		  {
		    b=k;
		  }
		  if(key[i]==d[k])
		  {
		    c=k;
		  }
		}
		e=(b*c);
		e=e%strlen(d);
		format(str,sizeof(str),"%s",d[e]);
	}
	return 1;
}
I think thats all the facts about it, have fun,


Re: [INC] Simple Encrypt - Niick_Boracao - 30.05.2010

good job


Re: [INC] Simple Encrypt - Joe Staff - 30.05.2010

If you look past the picture you'll see a sail boat.


Also, you'd be hard pressed to find a reason for this.
Good job none-the-less.