Closed 0xwal closed 3 years ago
Write the RC4 algorithm to encrypt/decrypt data.
src/include/rc4.h
src/rc4.c
tests/rc4.test.cpp
void rc4(const char* key, size_t keyLength, const char* plain, size_t plainLength, char* result);
key: "h"
plain: "foo"
result: "\xc7\x22\xc7"
key: "secret"
result: "\x8b\x59\xbd"
malloc
calloc
See Contribution Guide for more details.
Let me know if you are unable to write the tests, I will do that for you.
Also if you want any help let me know 😉.
Done 🚀
RC4 Encryption
Description:
Write the RC4 algorithm to encrypt/decrypt data.
Details:
Header:
src/include/rc4.h
Source file:
src/rc4.c
Test file:
tests/rc4.test.cpp
Signature:
Test Cases:
key: "h"
plain: "foo"
, output:result: "\xc7\x22\xc7"
key: "secret"
plain: "foo"
, output:result: "\x8b\x59\xbd"
Restriction:
malloc
,calloc
, etc.Note:
See Contribution Guide for more details.
Let me know if you are unable to write the tests, I will do that for you.
Also if you want any help let me know 😉.