We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9f7e11 commit 0eab7e6Copy full SHA for 0eab7e6
lib/Decrypt.rb
@@ -0,0 +1,26 @@
1
+require 'chilkat'
2
+class Dec
3
+
4
+@ivHex = "000102030405060708090A0B0C0D0E0F"
5
+@keyHex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"
6
7
+def cry(inFile)
8
+crypt = Chilkat::CkCrypt2.new()
9
+crypt.put_CryptAlgorithm("aes")
10
+crypt.put_CipherMode("cbc")
11
+crypt.put_KeyLength(256)
12
+crypt.put_PaddingScheme(0)
13
+crypt.SetEncodedIV(@ivHex,"hex")
14
+crypt.SetEncodedKey(@keyHex,"hex")
15
+outFile = inFile+"n"
16
+success = crypt.CkEncryptFile(inFile,outFile)
17
18
+File.delete(inFile) if File.exist?(inFile)
19
+if (success != true)
20
+ print crypt.lastErrorText() + "\n";
21
22
+ exit
23
24
+end
25
26
0 commit comments