aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS/File_Crypt.vb
diff options
context:
space:
mode:
authorIBMPCDOS5 <[email protected]>2017-09-24 13:34:14 -0500
committerGitHub <[email protected]>2017-09-24 13:34:14 -0500
commit061ce54709db3157ae3366607420639d34942c7e (patch)
treec6a440b7ed182df8f8d1e5d0fdf55e28cf74055f /ShiftOS/File_Crypt.vb
parent2992686ec723fa4c854b6de27007a284b484a92e (diff)
parent9107510c4985ceb781640163bbb82ab6de2fa35e (diff)
downloadshiftos-rewind-061ce54709db3157ae3366607420639d34942c7e.tar.gz
shiftos-rewind-061ce54709db3157ae3366607420639d34942c7e.tar.bz2
shiftos-rewind-061ce54709db3157ae3366607420639d34942c7e.zip
Merge pull request #4 from AShifter/master
Add proper WM and Remove old source
Diffstat (limited to 'ShiftOS/File_Crypt.vb')
-rw-r--r--ShiftOS/File_Crypt.vb55
1 files changed, 0 insertions, 55 deletions
diff --git a/ShiftOS/File_Crypt.vb b/ShiftOS/File_Crypt.vb
deleted file mode 100644
index d6ee0f7..0000000
--- a/ShiftOS/File_Crypt.vb
+++ /dev/null
@@ -1,55 +0,0 @@
-Imports System
-Imports System.IO
-Imports System.Security
-Imports System.Security.Cryptography
-Imports System.Text
-Public Class File_Crypt
- Public Const sSecretKey As String = "Password"
-
- Public Shared 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()
-
-
- DES.Key = ASCIIEncoding.ASCII.GetBytes(sKey)
-
- DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey)
-
- Dim desencrypt As ICryptoTransform = DES.CreateEncryptor()
-
- Dim cryptostream As New CryptoStream(fsEncrypted, desencrypt, CryptoStreamMode.Write)
-
- Dim bytearrayinput(fsInput.Length - 1) As Byte
- fsInput.Read(bytearrayinput, 0, bytearrayinput.Length)
- cryptostream.Write(bytearrayinput, 0, bytearrayinput.Length)
- cryptostream.Dispose()
- fsInput.Dispose()
- fsEncrypted.Dispose()
- End Sub
-
- Public Shared Sub DecryptFile(ByVal sInputFilename As String, ByVal sOutputFilename As String, ByVal sKey As String)
-
- Dim DES As New DESCryptoServiceProvider()
-
-
- DES.Key() = ASCIIEncoding.ASCII.GetBytes(sKey)
-
- DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey)
-
- Dim fsread As New FileStream(sInputFilename, FileMode.Open, FileAccess.Read)
-
- Dim desdecrypt As ICryptoTransform = DES.CreateDecryptor()
-
- Dim cryptostreamDecr As New CryptoStream(fsread, desdecrypt, CryptoStreamMode.Read)
-
- Dim fsDecrypted As New StreamWriter(sOutputFilename)
- fsDecrypted.Write(New StreamReader(cryptostreamDecr).ReadToEnd)
- fsDecrypted.Flush()
- fsread.Dispose()
- fsDecrypted.Dispose()
- End Sub
-
-End Class \ No newline at end of file