Sep 10, 2010 05:40 AM
(This post was last modified: Sep 10, 2010 05:49 AM by 6e756c6c.)
You should use Encoding.UTF8 instead of ASCII/Default. ASCII only supports the first 128 characters while UTF8 supports all 255 and it's backwards compatible with ASCII.
I also noticed you have an implementation of RSA which needs to be worked on actually since it's a public/private keyset.. but that's not what I wanted to talk about. Before 100 people start using it in their crypters it should be noted that RSA should only be used with very small amounts of data - such as a key for a symmetric encryption.
I have a video explaining asymmetric encryption if anyone is interested (was sick when I recorded it), here's a link.
http://www.youtube.com/watch?v=Wy5HuZlv9gY
(Sep 10, 2010 05:40 AM)6e756c6c Wrote: You should use Encoding.UTF8 instead of ASCII/Default. ASCII only supports the first 128 characters while UTF8 supports all 255 and it's backwards compatible with ASCII. I'll update that later thank you
Hello, i cant get the link to work :S... i have try in Firefox, IE, Chrome. Can you please upload to Some other site? etc Mediafire or something.
This works great mate! really good code mate.
I think you got something wrong there with your ROT13 function
Code Public Function ROT13(ByVal input As String) As String
Dim out As New System.Text.StringBuilder
For i As Integer = 0 To input.Length - 1
out.Append(Chr(Asc(input(i)) Xor 13)) '??
Next
Return out.ToString
End Function
You should take a look at this ROT13 function (encoding), not by me btw
Code Public Function ROT13Encode(ByVal InputText As String) As String
Dim i As Integer
Dim CurrentCharacter As Char
Dim CurrentCharacterCode As Integer
Dim EncodedText As String = ""
'Iterate through the length of the input parameter
For i = 0 To InputText.Length - 1
'Convert the current character to a char
CurrentCharacter = System.Convert.ToChar(InputText.Substring(i, 1))
'Get the character code of the current character
CurrentCharacterCode = Microsoft.VisualBasic.Asc(CurrentCharacter)
'Modify the character code of the character, - this
'so that "a" becomes "n", "z" becomes "m", "N" becomes "Y" and so on
If CurrentCharacterCode >= 97 And CurrentCharacterCode <= 109 Then
CurrentCharacterCode = CurrentCharacterCode + 13
Else
If CurrentCharacterCode >= 110 And CurrentCharacterCode <= 122 Then
CurrentCharacterCode = CurrentCharacterCode - 13
Else
If CurrentCharacterCode >= 65 And CurrentCharacterCode <= 77 Then
CurrentCharacterCode = CurrentCharacterCode + 13
Else
If CurrentCharacterCode >= 78 And CurrentCharacterCode <= 90 Then
CurrentCharacterCode = CurrentCharacterCode - 13
End If
End If
End If 'Add the current character to the string to be returned
End If
EncodedText = EncodedText + Microsoft.VisualBasic.ChrW(CurrentCharacterCode)
Next i
Return EncodedText
End Function 'ROT13Encode
Probably coding some useless shit.
Sep 10, 2010 12:13 PM
(This post was last modified: Sep 10, 2010 12:20 PM by pr0t0typ3.)
(Sep 10, 2010 11:37 AM)ubbelol Wrote: I think you got something wrong there with your ROT13 function
Code Public Function ROT13(ByVal input As String) As String
Dim out As New System.Text.StringBuilder
For i As Integer = 0 To input.Length - 1
out.Append(Chr(Asc(input(i)) Xor 13)) '??
Next
Return out.ToString
End Function
You should take a look at this ROT13 function (encoding), not by me btw
Code Public Function ROT13Encode(ByVal InputText As String) As String
Dim i As Integer
Dim CurrentCharacter As Char
Dim CurrentCharacterCode As Integer
Dim EncodedText As String = ""
'Iterate through the length of the input paramete
For i = 0 To InputText.Length - 1
'Convert the current character to a cha
CurrentCharacter = System.Convert.ToChar(InputText.Substring(i, 1))
'Get the character code of the current characte
CurrentCharacterCode = Microsoft.VisualBasic.Asc(CurrentCharacter)
'Modify the character code of the character, - this
'so that "a" becomes "n", "z" becomes "m", "N" becomes "Y" and so on
If CurrentCharacterCode >= 97 And CurrentCharacterCode <= 109 Then
CurrentCharacterCode = CurrentCharacterCode + 13
Else
If CurrentCharacterCode >= 110 And CurrentCharacterCode <= 122 Then
CurrentCharacterCode = CurrentCharacterCode - 13
Else
If CurrentCharacterCode >= 65 And CurrentCharacterCode <= 77 Then
CurrentCharacterCode = CurrentCharacterCode + 13
Else
If CurrentCharacterCode >= 78 And CurrentCharacterCode <= 90 Then
CurrentCharacterCode = CurrentCharacterCode - 13
End If
End If
End If 'Add the current character to the string to be returned
End If
EncodedText = EncodedText + Microsoft.VisualBasic.ChrW(CurrentCharacterCode)
Next i
Return EncodedText
End Function 'ROT13Encode
That is possible.... I just used Xor as it will also rotate by 13 but it is easier to code/reverse
P.S. I'll later post my Polycipher which is a simple Cipher String which returns Unique results each time but : They are only made of readable ascii values (33 - 255) so you can see them and use them in strings or what ever
You got some really bad coding practices Prototype.
A lot of unnecessary stuff like declaring temp vars and not really making use of the .net framework.
For example your md5 function:
Code Public Function MD5Hash(ByVal input As String) As String
Dim MD5 As New System.Security.Cryptography.MD5CryptoServiceProvider
Dim Data As Byte()
Dim Result As Byte()
Dim Res As String = ""
Dim Tmp As String = ""
Data = System.Text.Encoding.ASCII.GetBytes(input)
Result = MD5.ComputeHash(Data)
For i As Integer = 0 To Result.Length - 1
Tmp = Hex(Result(i))
If Len(Tmp) = 1 Then Tmp = "0" & Tmp
Res += Tmp
Next
Return Res
End Function
My Md5 Function:
VB
Code Private Shared Function MD5String(str As String) As String
Return BitConverter.ToString(MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(str))).Replace("-", "")
End Function
C#
Code static string MD5String(string str)
{
return BitConverter.ToString(MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(str))).Replace("-", "");
}
This could be applied to nearly ALL of your snippets.
Learn to code before teaching people bad ways of doing shit.
Sep 10, 2010 04:22 PM
(This post was last modified: Sep 10, 2010 04:23 PM by 6e756c6c.)
That's not nice Rue, your code has flaws in it too... like using ASCII encoding or defining an entire string for a single character. I'm not saying you are wrong, but you could be a bit more considerate with your criticism. :(
Sep 11, 2010 01:51 AM
(This post was last modified: Sep 11, 2010 09:50 AM by pr0t0typ3.)
(Sep 10, 2010 04:05 PM)Rue Wrote: You got some really bad coding practices Prototype.
A lot of unnecessary stuff like declaring temp vars and not really making use of the .net framework.
....
This could be applied to nearly ALL of your snippets.
Learn to code before teaching people bad ways of doing shit.
Edit: You are right but you are still a skiddish flamer and I hate you... You know exactly that what you said it not correct (about me not my code) and I hope you know that and remove it
(Sep 11, 2010 01:51 AM)pr0t0typ3 Wrote: Lol are you kidding me ? I tried to do smth. for this section and posted Source codes and everything you have to tell me is that I can't code because I used 6 lines more then you ? You should really think about what you post before you do it... Your code isn't perfect and I USE the .net Framework .. My Code is easier to understand and could be merged without any problems to like 3 lines but hey : In my code you can see what happens and understand it .. I coded this version for debugging and not for a final Application.. It is only a example how to do it
P.S. FUCK YOU ! I can code like 100 times as good as you or were you the first one to have a clean working x64 RunPE
Did have ever done anything to this forum except flaming ? I can't find any usefull thread by you
yah i agree with u dude 👍 ur sources are very usefull
(Sep 11, 2010 01:51 AM)pr0t0typ3 Wrote: P.S. FUCK YOU ! Well Said
(Sep 11, 2010 01:51 AM)pr0t0typ3 Wrote: I can't find any usefull thread by you And even better said 😉
(Sep 11, 2010 03:33 AM)Neroxan Wrote: Well Said
(Sep 11, 2010 01:51 AM)pr0t0typ3 Wrote: I can't find any usefull thread by you And even better said 😉 I can't tell you how glad I'm that I'm not the only one who thinks so
Thank you bro
I would highly appreciate constructive criticism and it is possible that my code is coded ugly and uses unnecessary vars but that is no reason to f**king flame my thread and tell me that I can't code.. If Rue would have posted it as a criticism and not a flame I would quickly fix the problems and thank him but this ways he is now just hated by me
well theres few problems
but he work
anyway just try to fix it
and stop fleming
|