Sinisterly
[HC-Official] Multiencoder (Python) - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Hacking (https://sinister.ly/Forum-Hacking)
+--- Forum: Hacking Tools (https://sinister.ly/Forum-Hacking-Tools)
+--- Thread: [HC-Official] Multiencoder (Python) (/Thread-HC-Official-Multiencoder-Python)

Pages: 1 2 3 4 5 6 7 8


RE: [HC-Official] Multiencoder (Python) - noize - 10-25-2013

I rewrote the code completely 'cause of the being shit of the older one.

Code:
class leet: def encode(self,string): alphabet = ['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','0','1','2','3','4','5','6','7','8','9','|','<','>','\\','/','-','G'] leet = ['4','8','<','>','3','f','9','|-|','1','j','k','|','|\/|','|\|','0','p','q','r','5','7','v','\/','w','x','y','2','o','i','z','e','a','s','G','t','b','g','l','c','d','m','n','-','6'] for i in range(0,len(alphabet)): string = string.replace(alphabet[i],leet[i]) return(string) def decode(self,string): alphabet = ['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','0','1','2','3','4','5','6','7','8','9','|','<','>','\\','/','-','G'] leet = ['4','8','<','>','3','f','9','|-|','1','j','k','|','|\/|','|\|','0','p','q','r','5','7','v','\/','w','x','y','2','o','i','z','e','a','s','G','t','b','g','l','c','d','m','n','-','6'] for i in range(0,len(alphabet)): string = string.replace(leet[i],alphabet[i]) return(string) def description(self): return ''' The leet encoding algorithm is based upon the 1337 speak well-known in the hackers' underground. Characters are replaced with numbers or groups of different characters resembling them. Example input string: Hello from LEET speak! Encoded string: |-|3||0 fr0|\/| |337 5p34|<! To avoid messing up cases and to allow this algorithm to be used combined with other case-sensitive encodings, only lowercase characters, numbers and the |, <, >, _, -, \, /, G characters are translated (G is the only uppercase character that is translated). The "\" and "/" characters are respectively translated from plain text to leet as "m" and "n". This is just to avoid messups in the translation. '''

changelog:
- switched to alphabets
- added description
- fixed case messing bug
- fixed some bugs on some chars' encodings
- removed a useless piece of code I had found

Now, I tried:

Code:
print leet.encode(leet(),"testme")

But the output was:

Code:
testlmnle

I just can't get what is going wrong right here.


RE: [HC-Official] Multiencoder (Python) - noize - 10-25-2013

I rewrote the code completely 'cause of the being shit of the older one.

Code:
class leet: def encode(self,string): alphabet = ['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','0','1','2','3','4','5','6','7','8','9','|','<','>','\\','/','-','G'] leet = ['4','8','<','>','3','f','9','|-|','1','j','k','|','|\/|','|\|','0','p','q','r','5','7','v','\/','w','x','y','2','o','i','z','e','a','s','G','t','b','g','l','c','d','m','n','-','6'] for i in range(0,len(alphabet)): string = string.replace(alphabet[i],leet[i]) return(string) def decode(self,string): alphabet = ['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','0','1','2','3','4','5','6','7','8','9','|','<','>','\\','/','-','G'] leet = ['4','8','<','>','3','f','9','|-|','1','j','k','|','|\/|','|\|','0','p','q','r','5','7','v','\/','w','x','y','2','o','i','z','e','a','s','G','t','b','g','l','c','d','m','n','-','6'] for i in range(0,len(alphabet)): string = string.replace(leet[i],alphabet[i]) return(string) def description(self): return ''' The leet encoding algorithm is based upon the 1337 speak well-known in the hackers' underground. Characters are replaced with numbers or groups of different characters resembling them. Example input string: Hello from LEET speak! Encoded string: |-|3||0 fr0|\/| |337 5p34|<! To avoid messing up cases and to allow this algorithm to be used combined with other case-sensitive encodings, only lowercase characters, numbers and the |, <, >, _, -, \, /, G characters are translated (G is the only uppercase character that is translated). The "\" and "/" characters are respectively translated from plain text to leet as "m" and "n". This is just to avoid messups in the translation. '''

changelog:
- switched to alphabets
- added description
- fixed case messing bug
- fixed some bugs on some chars' encodings
- removed a useless piece of code I had found

Now, I tried:

Code:
print leet.encode(leet(),"testme")

But the output was:

Code:
testlmnle

I just can't get what is going wrong right here.


RE: [HC-Official] Multiencoder (Python) - noize - 10-25-2013

I rewrote the code completely 'cause of the being shit of the older one.

Code:
class leet: def encode(self,string): alphabet = ['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','0','1','2','3','4','5','6','7','8','9','|','<','>','\\','/','-','G'] leet = ['4','8','<','>','3','f','9','|-|','1','j','k','|','|\/|','|\|','0','p','q','r','5','7','v','\/','w','x','y','2','o','i','z','e','a','s','G','t','b','g','l','c','d','m','n','-','6'] for i in range(0,len(alphabet)): string = string.replace(alphabet[i],leet[i]) return(string) def decode(self,string): alphabet = ['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','0','1','2','3','4','5','6','7','8','9','|','<','>','\\','/','-','G'] leet = ['4','8','<','>','3','f','9','|-|','1','j','k','|','|\/|','|\|','0','p','q','r','5','7','v','\/','w','x','y','2','o','i','z','e','a','s','G','t','b','g','l','c','d','m','n','-','6'] for i in range(0,len(alphabet)): string = string.replace(leet[i],alphabet[i]) return(string) def description(self): return ''' The leet encoding algorithm is based upon the 1337 speak well-known in the hackers' underground. Characters are replaced with numbers or groups of different characters resembling them. Example input string: Hello from LEET speak! Encoded string: |-|3||0 fr0|\/| |337 5p34|<! To avoid messing up cases and to allow this algorithm to be used combined with other case-sensitive encodings, only lowercase characters, numbers and the |, <, >, _, -, \, /, G characters are translated (G is the only uppercase character that is translated). The "\" and "/" characters are respectively translated from plain text to leet as "m" and "n". This is just to avoid messups in the translation. '''

changelog:
- switched to alphabets
- added description
- fixed case messing bug
- fixed some bugs on some chars' encodings
- removed a useless piece of code I had found

Now, I tried:

Code:
print leet.encode(leet(),"testme")

But the output was:

Code:
testlmnle

I just can't get what is going wrong right here.


RE: [HC-Official] Multiencoder (Python) - Deque - 10-26-2013

@noize: The problem is here:

Code:
for i in range(0,len(alphabet)): string = string.replace(alphabet[i],leet[i])

The replace function goes through all characters of the string to replace them - from beginning to the end, no matter if they already where replaced.
So if you try to encode the character "t" (from "testme"), it will find "t" in alphabet and replace it with "7". Some time later it will find "7" in alphabet and replace it with "t". That's why it looks the way it is now.

I suggest that you iterate through all characters of the string and look then for that specific character how to replace it.

In pseudocode:

Code:
for every character c in string: translate c



RE: [HC-Official] Multiencoder (Python) - Deque - 10-26-2013

@noize: The problem is here:

Code:
for i in range(0,len(alphabet)): string = string.replace(alphabet[i],leet[i])

The replace function goes through all characters of the string to replace them - from beginning to the end, no matter if they already where replaced.
So if you try to encode the character "t" (from "testme"), it will find "t" in alphabet and replace it with "7". Some time later it will find "7" in alphabet and replace it with "t". That's why it looks the way it is now.

I suggest that you iterate through all characters of the string and look then for that specific character how to replace it.

In pseudocode:

Code:
for every character c in string: translate c



RE: [HC-Official] Multiencoder (Python) - Deque - 10-26-2013

@noize: The problem is here:

Code:
for i in range(0,len(alphabet)): string = string.replace(alphabet[i],leet[i])

The replace function goes through all characters of the string to replace them - from beginning to the end, no matter if they already where replaced.
So if you try to encode the character "t" (from "testme"), it will find "t" in alphabet and replace it with "7". Some time later it will find "7" in alphabet and replace it with "t". That's why it looks the way it is now.

I suggest that you iterate through all characters of the string and look then for that specific character how to replace it.

In pseudocode:

Code:
for every character c in string: translate c



RE: [HC-Official] Multiencoder (Python) - Deque - 10-26-2013

@noize: The problem is here:

Code:
for i in range(0,len(alphabet)): string = string.replace(alphabet[i],leet[i])

The replace function goes through all characters of the string to replace them - from beginning to the end, no matter if they already where replaced.
So if you try to encode the character "t" (from "testme"), it will find "t" in alphabet and replace it with "7". Some time later it will find "7" in alphabet and replace it with "t". That's why it looks the way it is now.

I suggest that you iterate through all characters of the string and look then for that specific character how to replace it.

In pseudocode:

Code:
for every character c in string: translate c



RE: [HC-Official] Multiencoder (Python) - noize - 10-27-2013

I removed a few characters from the leet alphabet as it was causing translation problems, but especially 'cause it would be painful to handle "characters" like "/\/\" when dealing with a foreach-character loop.

It is now running smoothly for what I see.


RE: [HC-Official] Multiencoder (Python) - noize - 10-27-2013

I removed a few characters from the leet alphabet as it was causing translation problems, but especially 'cause it would be painful to handle "characters" like "/\/\" when dealing with a foreach-character loop.

It is now running smoothly for what I see.


RE: [HC-Official] Multiencoder (Python) - noize - 10-27-2013

I removed a few characters from the leet alphabet as it was causing translation problems, but especially 'cause it would be painful to handle "characters" like "/\/\" when dealing with a foreach-character loop.

It is now running smoothly for what I see.