Click here to Skip to main content
15,883,925 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello dears
iam Kero ,

iam begginer at vb.net coding and i need your help to reset this code
i get this code from program made by vb.net and i get the code using
code reflector 9.0 and iam using vb express 2008

any one can help me how to use this code
and how to get use of it

thanks and best regards
Kero

;
VB
Friend Shared Function TripleDESEncryptTo46StringBase(ByVal [text] As String) As String
    Dim buffer As Byte()
    Dim buffer2 As Byte()
    Dim buffer3 As Byte()
    Dim stream As MemoryStream
    Dim provider As TripleDESCryptoServiceProvider
    Dim stream2 As CryptoStream
    Dim str As String
    buffer = Encoding.UTF8.GetBytes([text])
    buffer2 = Encoding.UTF8.GetBytes("SmartSolutions_AhmedSaid")
    buffer3 = Encoding.UTF8.GetBytes("Abu_Said")
    stream = New MemoryStream
    provider = New TripleDESCryptoServiceProvider
    stream2 = New CryptoStream(stream, provider.CreateEncryptor(buffer2, buffer3), 1)
    stream2.Write(buffer, 0, CInt(buffer.Length))
    stream2.FlushFinalBlock
    str = Convert.ToBase64String(stream.ToArray)
Label_0070:
    Return str
End Function


What I have tried:

VB
Friend Shared Function TripleDESEncryptTo46StringBase(ByVal [text] As String) As String
    Dim buffer As Byte()
    Dim buffer2 As Byte()
    Dim buffer3 As Byte()
    Dim stream As MemoryStream
    Dim provider As TripleDESCryptoServiceProvider
    Dim stream2 As CryptoStream
    Dim str As String
    buffer = Encoding.UTF8.GetBytes([text])
    buffer2 = Encoding.UTF8.GetBytes("SmartSolutions_AhmedSaid")
    buffer3 = Encoding.UTF8.GetBytes("Abu_Said")
    stream = New MemoryStream
    provider = New TripleDESCryptoServiceProvider
    stream2 = New CryptoStream(stream, provider.CreateEncryptor(buffer2, buffer3), 1)
    stream2.Write(buffer, 0, CInt(buffer.Length))
    stream2.FlushFinalBlock
    str = Convert.ToBase64String(stream.ToArray)
Label_0070:
    Return str
End Function
Posted
Updated 4-Oct-17 20:13pm
v2
Comments
GKP1992 5-Oct-17 0:18am    
Few questions:
1. What do you mean by resetting the code?
2. Do you mean you decompiled an assembly to get the code?
3. How do you want to use the code?
If you just want to encrypt something you can just add a reference of the assembly you decompiled to your project, and call the method you are trying to "reset" with the text you want to encrypt. Pretty straight forward. Beyond that, it is a research topic. You are on your own.
kero4000 5-Oct-17 2:10am    
thank you very much for your answer
1- reset the code mean making it suitable to ruse cause when i paste it in visual express it gives error
2- i cant understand the 2nd Q i get the code using program called Code Reflect
3- i want to under stand the code and how to use it again

Easy could you please use the same code in a project and attach an example how to use it ???

thanks and sorry for misunderstanding

1 solution

At a guess you are trying to reverse the encryption of something without the original author's knowledge. Almost certainly, that is malicious activity, and we do not condone, support, or assist in the production of malicious code in any way, form, or manner. This is a professional site for professional developers.

If you can explain what you are doing, and why, you may get some help, but without that - not a thing.
 
Share this answer
 
Comments
GKP1992 5-Oct-17 2:22am    
Exactly my thoughts.
kero4000 5-Oct-17 3:36am    
dear teacher ,
i think you misunderstand me ,
i explain that iam beginner in vb.net , i learn by decompiling ready made exe
no malicious or any thing else.
i want to under stand how encryption can be in vb.net using this code
i dont need to reverse the encryption

sorry for any misunderstanding
OriginalGriff 5-Oct-17 3:50am    
You learn nothing by decompiling: absolutely nothing of any use whatsoever.
You learn by doing, by thinking: looking at the mess of code that decompilation produces tells you nothing of any use about how it was originally written, or why.

Instead of this approach get a book - or better a course - and follow it from beginning to end, doing all the exercises. You will learn a lot more, in a shorter time, than you ever could by messing with compiled code.
kero4000 5-Oct-17 4:01am    
thank you very much for your co-operation
and for understanding me ,
i thought that it will be easier , faster and flexible by decompiling apps that i like
ok , then can you please help me by book , videos that i can learn from it at home ??
and can you please adjust this code to be suitable for using it ?
i dont know why when i paste it at vb express it gives error
whats wrong in the code ?
finally i want to know what is the value of "str"

sincerely
Kero
OriginalGriff 5-Oct-17 4:13am    
Wrox do good ones, so do Addison Wesley. Microsoft press also come well recommended. A course is better though - you can ask questions of the tutor if you don't understand something.
Avoid videos like the plague - they are mostly made by people who know nothing about the subject but have something that works in one specific situation though they have no idea why or how to teach!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900