vitu8 (11-20-2010)
Is there a source for a Encrypter/Decrypter (needs password to access)? Cause i need it for my laptop.
vitu8 (11-20-2010)
heres code for encryption. Theres a function for strings and bytes for each encryption type.
Code:Imports System.Security.Cryptography Module Encryption Public Function AESEncrypt(ByVal Key As String, ByVal Data As String) As String Try Dim AES As AesCryptoServiceProvider With AES .Mode = CipherMode.ECB .Key = System.Text.ASCIIEncoding.ASCII.GetBytes(Key) .IV = .Key End With Dim AESEncryptor As ICryptoTransform = AES.CreateEncryptor Dim DataBuffer As Byte() Dim EncryptedData As Byte() DataBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(Data) EncryptedData = AESEncryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return ByteToString(EncryptedData) Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function AESEncrypt(ByVal Key() As Byte, ByVal Data() As Byte) As Byte() Try Dim AES As AesCryptoServiceProvider With AES .Mode = CipherMode.ECB .Key = Key .IV = .Key End With Dim AESEncryptor As ICryptoTransform = AES.CreateEncryptor Dim DataBuffer As Byte() Dim EncryptedData As Byte() DataBuffer = Data EncryptedData = AESEncryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return EncryptedData Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function AESDecrypt(ByVal Key() As Byte, ByVal Data() As Byte) As Byte() Try Dim AES As AesCryptoServiceProvider With AES .Mode = CipherMode.ECB .Key = Key .IV = .Key End With Dim AESDecryptor As ICryptoTransform = AES.CreateDecryptor Dim DataBuffer As Byte() Dim DecryptedData As Byte() DataBuffer = Data DecryptedData = AESDecryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return DecryptedData Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function AESDecrypt(ByVal Key As String, ByVal Data As String) As String Try Dim AES As AesCryptoServiceProvider With AES .Mode = CipherMode.ECB .Key = System.Text.ASCIIEncoding.ASCII.GetBytes(Key) .IV = .Key End With Dim AESDecryptor As ICryptoTransform = AES.CreateDecryptor Dim DataBuffer As Byte() Dim DecryptedData As Byte() DataBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(Data) DecryptedData = AESDecryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return ByteToString(DecryptedData) Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function RC2Encrypt(ByVal Key As String, ByVal Data As String) As Byte() Try Dim RC2 As RC2CryptoServiceProvider With RC2 .Mode = CipherMode.ECB .UseSalt = True .Key = System.Text.ASCIIEncoding.ASCII.GetBytes(Key) .IV = .Key End With Dim RC2Encryptor As ICryptoTransform = RC2.CreateEncryptor Dim databuffer As Byte() Dim EncryptedData As Byte() databuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(Data) EncryptedData = RC2Encryptor.TransformFinalBlock(databuffer, 0, databuffer.Length) Return EncryptedData Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function RC2Encrypt(ByVal Key() As Byte, ByVal Data() As Byte) As Byte() Try Dim RC2 As RC2CryptoServiceProvider With RC2 .Mode = CipherMode.ECB .UseSalt = True .Key = Key .IV = .Key End With Dim RC2Encryptor As ICryptoTransform = RC2.CreateEncryptor Dim databuffer As Byte() Dim EncryptedData As Byte() databuffer = Data EncryptedData = RC2Encryptor.TransformFinalBlock(databuffer, 0, databuffer.Length) Return EncryptedData Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function RC2Decrypt(ByVal key() As Byte, ByVal data() As Byte) As Byte() Try Dim RC2 As RC2CryptoServiceProvider With RC2 .Mode = CipherMode.ECB .UseSalt = True .Key = key .IV = .Key End With Dim RC2Decryptor As ICryptoTransform = RC2.CreateDecryptor Dim databuffer As Byte() Dim Decrypteddata As Byte() databuffer = data Decrypteddata = RC2Decryptor.TransformFinalBlock(databuffer, 0, databuffer.Length) Return Decrypteddata Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function RC2Decrypt(ByVal Key As String, ByVal Data As String) As String Try Dim RC2 As RC2CryptoServiceProvider With RC2 .Mode = CipherMode.ECB .UseSalt = True .Key = System.Text.ASCIIEncoding.ASCII.GetBytes(Key) .IV = .Key End With Dim RC2Decryptor As ICryptoTransform = RC2.CreateDecryptor Dim DataBuffer As Byte() Dim DecryptedData As Byte() DataBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(Data) DecryptedData = RC2Decryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return ByteToString(DecryptedData) Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function DESEncrypt(ByVal Key As String, ByVal Data As String) As String Try Dim DES As DESCryptoServiceProvider With DES .Mode = CipherMode.ECB .Key = System.Text.ASCIIEncoding.ASCII.GetBytes(Key) .IV = .Key End With Dim DESEncryptor As ICryptoTransform = DES.CreateEncryptor Dim DataBuffer As Byte() Dim EncryptedData As Byte() DataBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(Data) EncryptedData = DESEncryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return ByteToString(EncryptedData) Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function DESEncrypt(ByVal key() As Byte, ByVal data() As Byte) As Byte() Try Dim DES As DESCryptoServiceProvider With DES .Mode = CipherMode.ECB .Key = key .IV = .Key End With Dim DESEncryptor As ICryptoTransform = DES.CreateEncryptor Dim DataBuffer As Byte() Dim Encrypteddata As Byte() DataBuffer = data Encrypteddata = DESEncryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return Encrypteddata Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function DESDecrypt(ByVal Key As String, ByVal Data As String) As String Try Dim DES As DESCryptoServiceProvider With DES .Mode = CipherMode.ECB .Key = System.Text.ASCIIEncoding.ASCII.GetBytes(Key) .IV = .Key End With Dim DESDecryptor As ICryptoTransform = DES.CreateDecryptor Dim DataBuffer As Byte() Dim DecryptedData As Byte() DataBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(Data) DecryptedData = DESDecryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return ByteToString(DecryptedData) Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function DESDecrypt(ByVal Key() As Byte, ByVal data() As Byte) As Byte() Try Dim DES As DESCryptoServiceProvider With DES .Mode = CipherMode.ECB .Key = Key .IV = .Key End With Dim DESDecryptor As ICryptoTransform = DES.CreateDecryptor Dim DataBuffer As Byte() Dim DecryptedData As Byte() DataBuffer = data DecryptedData = DESDecryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return DecryptedData Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function TripleDESEncrypt(ByVal Key As String, ByVal Data As String) As String Try Dim TripleDes As TripleDESCryptoServiceProvider With TripleDes .Mode = CipherMode.ECB .Key = System.Text.ASCIIEncoding.ASCII.GetBytes(Key) .IV = .Key End With Dim TripleDESEncryptor As ICryptoTransform = TripleDes.CreateEncryptor Dim DataBuffer As Byte() Dim EncryptedData As Byte() DataBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(Data) EncryptedData = TripleDESEncryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return ByteToString(EncryptedData) Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function TripleDESEncrypt(ByVal key As Byte(), ByVal data As Byte()) As Byte() Try Dim TripleDes As TripleDESCryptoServiceProvider With TripleDes .Mode = CipherMode.ECB .Key = key .IV = .Key End With Dim TripleDESEncryptor As ICryptoTransform = TripleDes.CreateEncryptor Dim DataBuffer As Byte() Dim EncryptedData As Byte() DataBuffer = data EncryptedData = TripleDESEncryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return EncryptedData Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function TriplesDESDecrypt(ByVal key As Byte(), ByVal Data As Byte()) As Byte() Try Dim TripleDes As TripleDESCryptoServiceProvider With TripleDes .Mode = CipherMode.ECB .Key = key .IV = .Key End With Dim TripleDESDecryptor As ICryptoTransform = TripleDes.CreateDecryptor Dim DataBuffer As Byte() Dim DecryptedData As Byte() DataBuffer = Data DecryptedData = TripleDESDecryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return DecryptedData Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function TripleDESDecrypt(ByVal Key As String, ByVal Data As String) As String Try Dim TripleDes As TripleDESCryptoServiceProvider With TripleDes .Mode = CipherMode.ECB .Key = System.Text.ASCIIEncoding.ASCII.GetBytes(Key) .IV = .Key End With Dim TripleDESDecryptor As ICryptoTransform = TripleDes.CreateDecryptor Dim DataBuffer As Byte() Dim DecryptedData As Byte() DataBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(Data) DecryptedData = TripleDESDecryptor.TransformFinalBlock(DataBuffer, 0, DataBuffer.Length) Return ByteToString(DecryptedData) Catch ex As Exception MessageBox.Show("The Following Error(s) occured: " & ex.Message, "Error", MessageBoxButtons.OK) End Try End Function Public Function ByteToString(ByVal Bytes As Byte()) As String Return Convert.ToString(Bytes) End Function End Module
"I don't believe in an afterlife, so I don't have to spend my whole life fearing hell, or fearing heaven even more. For whatever the tortures of hell, I think the boredom of heaven would be even worse." - Isaac Asimov
What? I didnt understand what that is.
And what is the button codec to encrypt?
Edit: I get 32 Warnings:
Code:Warning 1 Variable 'AES' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 6 18 WindowsApplication1 Warning 2 Function 'AESEncrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 20 5 WindowsApplication1 Warning 3 Variable 'AES' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 26 18 WindowsApplication1 Warning 4 Function 'AESEncrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 40 5 WindowsApplication1 Warning 5 Variable 'AES' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 46 18 WindowsApplication1 Warning 6 Function 'AESDecrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 60 5 WindowsApplication1 Warning 7 Variable 'AES' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 66 18 WindowsApplication1 Warning 8 Function 'AESDecrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 80 5 WindowsApplication1 Warning 9 Variable 'RC2' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 86 18 WindowsApplication1 Warning 10 Function 'RC2Encrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 101 5 WindowsApplication1 Warning 11 Variable 'RC2' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 106 18 WindowsApplication1 Warning 12 Function 'RC2Encrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 121 5 WindowsApplication1 Warning 13 Variable 'RC2' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 126 18 WindowsApplication1 Warning 14 Function 'RC2Decrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 141 5 WindowsApplication1 Warning 15 Variable 'RC2' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 146 18 WindowsApplication1 Warning 16 Function 'RC2Decrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 161 5 WindowsApplication1 Warning 17 Variable 'DES' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 166 18 WindowsApplication1 Warning 18 Function 'DESEncrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 180 5 WindowsApplication1 Warning 19 Variable 'DES' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 185 18 WindowsApplication1 Warning 20 Function 'DESEncrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 199 5 WindowsApplication1 Warning 21 Variable 'DES' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 206 18 WindowsApplication1 Warning 22 Function 'DESDecrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 220 5 WindowsApplication1 Warning 23 Variable 'DES' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 225 18 WindowsApplication1 Warning 24 Function 'DESDecrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 239 5 WindowsApplication1 Warning 25 Variable 'TripleDes' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 244 18 WindowsApplication1 Warning 26 Function 'TripleDESEncrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 258 5 WindowsApplication1 Warning 27 Variable 'TripleDes' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 263 18 WindowsApplication1 Warning 28 Function 'TripleDESEncrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 277 5 WindowsApplication1 Warning 29 Variable 'TripleDes' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 283 18 WindowsApplication1 Warning 30 Function 'TriplesDESDecrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 297 5 WindowsApplication1 Warning 31 Variable 'TripleDes' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 302 18 WindowsApplication1 Warning 32 Function 'TripleDESDecrypt' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Encryption.vb 316 5 WindowsApplication1
Last edited by o0OpurezO0o; 11-20-2010 at 05:06 PM.
Even though I am anti ignoring warnings. I wrote a whole article on it, those warnings can be ignored. The application will still build with warnings, and will still work.
What WTF neglected to mention is the code he is providing is a rendition of a old module with some minor declaration changes (Microsoft standard btw) in either case, it simply means that each of those functions can return null, but I wouldn't worry about it.
In general, This may help you out.
https://support.microsof*****m/kb/301070
Same source (again with original declarations), just with explanations.
Full source, From MSDN
Code:Imports System Imports System.IO Imports System.Security Imports System.Security.Cryptography Imports System****ntime.InteropServices Imports System.Text Module Module1 ' Call this function to remove the key from memory after it is used for security. <DllImport("kernel32.dll")> _ Public Sub ZeroMemory(ByVal addr As IntPtr, ByVal size As Integer) End Sub ' Function to generate a 64-bit key. Function GenerateKey() As String ' Create an instance of a symmetric algorithm. The key and the IV are generated automatically. Dim desCrypto As DESCryptoServiceProvider = DESCryptoServiceProvider.Create() ' Use the automatically generated key for encryption. Return ASCIIEncoding.ASCII.GetString(desCrypto.Key) End Function Sub EncryptFile(ByVal sInputFilename As String, _ ByVal sOutputFilename As String, _ ByVal sKey As String) Dim fsInput As New FileStream(sInputFilename, _ FileMode.Open, FileAccess.Read) Dim fsEncrypted As New FileStream(sOutputFilename, _ FileMode.Create, FileAccess.Write) Dim DES As New DESCryptoServiceProvider() 'Set secret key for DES algorithm. 'A 64-bit key and an IV are required for this provider. DES.Key = ASCIIEncoding.ASCII.GetBytes(sKey) 'Set the initialization vector. DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey) 'Create the DES encryptor from this instance. Dim desencrypt As ICryptoTransform = DES.CreateEncryptor() 'Create the crypto stream that transforms the file stream by using DES encryption. Dim cryptostream As New CryptoStream(fsEncrypted, _ desencrypt, _ CryptoStreamMode.Write) 'Read the file text to the byte array. Dim bytearrayinput(fsInput.Length - 1) As Byte fsInput.Read(bytearrayinput, 0, bytearrayinput.Length) 'Write out the DES encrypted file. cryptostream.Write(bytearrayinput, 0, bytearrayinput.Length) cryptostream.Close() End Sub Sub DecryptFile(ByVal sInputFilename As String, _ ByVal sOutputFilename As String, _ ByVal sKey As String) Dim DES As New DESCryptoServiceProvider() 'A 64-bit key and an IV are required for this provider. 'Set the secret key for the DES algorithm. DES.Key() = ASCIIEncoding.ASCII.GetBytes(sKey) 'Set the initialization vector. DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey) 'Create the file stream to read the encrypted file back. Dim fsread As New FileStream(sInputFilename, FileMode.Open, FileAccess.Read) 'Create the DES decryptor from the DES instance. Dim desdecrypt As ICryptoTransform = DES.CreateDecryptor() 'Create the crypto stream set to read and to do a DES decryption transform on incoming bytes. Dim cryptostreamDecr As New CryptoStream(fsread, desdecrypt, CryptoStreamMode.Read) 'Print out the contents of the decrypted file. Dim fsDecrypted As New StreamWriter(sOutputFilename) fsDecrypted.Write(New StreamReader(cryptostreamDecr).ReadToEnd) fsDecrypted.Flush() fsDecrypted.Close() End Sub Public Sub Main() 'Must be 64 bits, 8 bytes. Dim sSecretKey As String ' Get the key for the file to encrypt. ' You can distribute this key to the user who will decrypt the file. sSecretKey = GenerateKey() ' For additional security, pin the key. Dim gch As GCHandle = GCHandle.Alloc(sSecretKey, GCHandleType.Pinned) ' Encrypt the file. EncryptFile("%USERPROFILE%\MyData.txt", _ "%USERPROFILE%\Encrypted.txt", _ sSecretKey) ' Decrypt the file. DecryptFile("%USERPROFILE%\Encrypted.txt", _ "%USERPROFILE%\Decrypted.txt", _ sSecretKey) ' Remove the key from memory. ZeroMemory(gch.AddrOfPinnedObject(), sSecretKey.Length * 2) gch.Free() End Sub End Module
Last edited by NextGen1; 11-20-2010 at 05:33 PM.
o0OpurezO0o (11-20-2010)
It's a warning, who cares?
[MPGH]master131 (11-20-2010)
OK, so the two Codes:
i put in the two buttons i want to Encrypt/Decrypt?Code:' Encrypt the file. EncryptFile("%USERPROFILE%\MyData.txt", _ "%USERPROFILE%\Encrypted.txt", _ sSecretKey) ' Decrypt the file. DecryptFile("%USERPROFILE%\Encrypted.txt", _ "%USERPROFILE%\Decrypted.txt", _ sSecretKey)
BTW thanks NextGen.
anyone? answer please
Last edited by Lolland; 11-21-2010 at 09:17 PM.
This
Is a sample, You will need to add one buttonCode:EncryptFile("%USERPROFILE%\MyData.txt", _ "%USERPROFILE%\Encrypted.txt", _ sSecretKey) ' Decrypt the file. DecryptFile("%USERPROFILE%\Encrypted.txt", _ "%USERPROFILE%\Decrypted.txt", _ sSecretKey)
Encrypt
and another
Decrypt
Then use the functions
In a example would beCode:EncryptFile(ByVal sInputFilename As String, _ ByVal sOutputFilename As String, _ ByVal sKey As String)
This will encrypt the file test.txt and create a new encrypted file (from the original) called TestEncrypted.txt.Code:EncryptFile("C:\test.txt","C:\TestEncrypted.txt, sSecretKey)
Do the same to decrypt.
Make sense?
ERRORS!
Code:Error 1 Expression expected. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 7 21 WindowsApplication1 Error 2 Expression expected. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 8 19 WindowsApplication1 Error 3 Expression expected. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 9 19 WindowsApplication1 Error 4 Argument not specified for parameter 'sKey' of 'Public Sub EncryptFile(sInputFilename As String, sOutputFilename As String, sKey As String)'. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 11 9 WindowsApplication1 Error 5 String constants must end with a double quote. C:\Users\Owner\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 11 35 WindowsApplication1
All pretty self explanatory errors. You forgot a double quote at the end of a string, forgot to pass the third parameter into the Encryption function and whatever the first ones were.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
Please read over your errors before you post them /fp
[MPGH]master131 (11-21-2010)
Copy & Paste usually leads to several errors.
Insane (11-22-2010)
Light travels faster than sound. That's why most people seem bright until you hear them speak.
Lolland (11-22-2010)
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
I read them, i'm not a good error/warning reader.
@NextGen1 Im still awaiting on that book you told me bout. Just notfy me about the progress.
There are many warnings that you can ignore, and many that you cannot. In Visual Basic, they've pretty much made it so that every warning that should not be ignored is now an error, so it's easier for people to grasp the language.
I do code in C, by the way. (Not much though, mainly C++)