summaryrefslogtreecommitdiffstats
path: root/src/crypt/cryptrc4.cpp
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-05-05 14:14:46 +0200
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-05-05 14:14:46 +0200
commita2737677508333c18253730b46b6c368e4743eac (patch)
tree7f138914c21784674777a42fd4a1116cf3ed2b01 /src/crypt/cryptrc4.cpp
parentbe846db403c29c77bfb72633d87a7c72a48562b6 (diff)
downloadIT-Sicherheit-a2737677508333c18253730b46b6c368e4743eac.tar.gz
IT-Sicherheit-a2737677508333c18253730b46b6c368e4743eac.zip
Add RC4 encryption from OpenSSL
Diffstat (limited to 'src/crypt/cryptrc4.cpp')
-rw-r--r--src/crypt/cryptrc4.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/crypt/cryptrc4.cpp b/src/crypt/cryptrc4.cpp
new file mode 100644
index 0000000..701525d
--- /dev/null
+++ b/src/crypt/cryptrc4.cpp
@@ -0,0 +1,19 @@
+#include "cryptrc4.h"
+
+CryptRc4::CryptRc4()
+{
+
+}
+
+void CryptRc4::rc4SetKey(QByteArray key)
+{
+ RC4_set_key(&m_rc4Key, key.length(), (const unsigned char *) key.data());
+}
+
+QByteArray CryptRc4::rc4Run(QByteArray clear)
+{
+ QByteArray crypt(clear);
+ RC4(&m_rc4Key, clear.length(), (const unsigned char *) clear.data(), (unsigned char *) crypt.data());
+ return crypt;
+}
+