🔐RC4 (optimized)

by Ricardo Fernández Serrata

Version 7 (January 17, 2021)

Download (5 downloads)

Encryption/Decryption using Rivest Cipher v4 algorithm. SHA-256 is used as Key Derivation Function here.

Some pros about RC4 are that output has exactly the same size as input, and you can encrypt or decrypt without having to specify which you want to do (XOR cipher also has these pros). Cons are, this is highly insecure, even with the KDF.

For higher security, use the output of /dev/random as an OTP and avoid using the KDF so that the key can be indefinitely large (increasing entropy)

I was planning to make the keystream salted, but that would have these cons:
- Slightly bigger output, because the salt must be included.
- Increased memory allocation, because input and output must be separated.
- 2 functions/algorithms, 1 for encryption and the other for decryption. Instead of just 1.
- Unnecessary code complexity.

ℹ en.wikipedia.org/wiki/RC4

Original (used as base/template): llamalab.com/automate/community/flows/25728

4.0 average rating from 1 reviews

5 stars
0
4 stars
1
3 stars
0
2 stars
0
1 star
0
Reports
0

Reviews and ratings can be submitted in the app.