RC4 in cryptography is a widely used stream cipher. It's most common application is the WEP security algorithm. RC4 is fairly simple to understand and implement, on the other side, however, strong attacks on RC4 are known.
Questions tagged [rc4-cipher]
143 questions
1
vote
1 answer
How to decrypt data at Application Layer of HTTPS?
I'm writing an web server with Lisp to handler HTTPS request. I followed TLS 1.2 and already completed the handshake process. The Cipher Suite I chose is TLS_RSA_WITH_RC4_128_SHA. I already calculated client_write_MAC_secret,…

Wise Simpson
- 305
- 3
- 9
1
vote
1 answer
Own RC4 algorithm giving wrong output
I've written the following implementation of the RC4 algorithm, where key is a RC4_KEY struct as given in the OpenSSL library. m_key is a QByteArray containing the set key. For this test, I have been using "teste" as key. As you can see, I have two…

Steffen
- 3,999
- 1
- 23
- 30
1
vote
1 answer
RC4 Drop-N PHP Implementation
I have an implementation of the RC4 cipher in PHP already (it looks almost indentical to this http://pear.php.net/package/Crypt_RC42).
However, I'd like to introduce the "Drop-N" approach as mentioned in…

Schodem
- 11
- 1
1
vote
1 answer
Sending byte[] through UDP causing byte[] value to change
I'm trying to do a server client communication using UDP and it involves sending encrypted text using RC4 to each other. It goes something like this:
Start Host.
Start Client.
Client sends encrypted text using RC4
Host receive encrypted text and…

user1958567
- 67
- 1
- 6
1
vote
2 answers
Writing a C++ iostream that uses the RC4 stream cipher. How can I optimize my implementation?
I am implementing a custom iostream (i.e., with read, write, seek and close) which uses the RC4 stream cipher for encryption and decryption. One of the contracts of this stream is that it is bidirectional and calling code needs to be able to…

Ben J
- 1,367
- 2
- 15
- 33
1
vote
1 answer
Matlab program is showing incorrect result in one function
This below program is a converted version from another C program. Function rc4key is showing correct result but function prga is showing incorrect result (comparing to the C, the correct program), I am trying for quite long time but can't understand…

Bee
- 175
- 1
- 10
1
vote
1 answer
Encrypt a string in java and decryption in VBScript using RC4
I have a code in vb script which i am trying to convert it into java .
Here is my VBScript:
Sub a()
strEncrypt = "jane"
strKey = "apple"
intSeed = "6"
strEncryptedText = RunRC4(strEncrypt, strKey)
MsgBox (strEncryptedText)
strDecryptedText =…

jane
- 303
- 1
- 4
- 18
1
vote
1 answer
RC4 Safe to use plaintext as the key to encrypt itself?
Basically what the title says. If I have a password, of say "APPLEPIE" is it safe to use "APPLEPIE" as the key when I RC4 it? Is it possible to break the RC4 encryption when you know the Key and Plaintext or are short and the same?

Byron Fergo
- 35
- 7
1
vote
2 answers
Implementing RC4 on Racket
I'm trying to translate a C# implementation of the RC4 cipher I wrote to the Racket language.
However, they are producing different keystreams. I have already eliminated the possiblity of miswriting the key-scheduling phase; that must be correct as…

ithisa
- 752
- 1
- 8
- 25
1
vote
1 answer
MS CryptoAPI giving wrong RC4 Results?
I am working on a product that needs to be able to consume files created with an older product. Some of these files contain content encrypted with RC4 encryption using MS CryptoAPI. I have thus far been unable to successfully decrypt the content…

Derek P. Miller
- 21
- 4
1
vote
1 answer
How to encode a Javascript string to Unicode and decode it to utf-8 in PHP?
I have tried a couple of ways but it does't work.
Now I have 2 problems that I cannot figure out.
I can't figure out how to encode a string in JavaScript to Unicode and decode using $value = iconv('UCS-2LE', 'UTF-8', $_GET["value"]); in PHP
I…

suika liang
- 21
- 3
1
vote
3 answers
CipherSaber bug
So I implemented ciphersaber-1. It almost works, I can decrypt the cstest1.cs1. But i have trouble getting cstest2.cs1 to work.
The output is:
The Fourth Amendment to the Constitution of the Unite ▀Stat→s of America
"The right o☻ the people to be…

rioki
- 5,988
- 5
- 32
- 55
1
vote
1 answer
Fast RC4 cipher stream for Python?
I'm trying to write an app that needs large numbers of cryptographic strength pseudorandom bytes.
The RC4 cipher would be ideal for this; it's lightweight and simple to understand conceptually. So, I got the spec and wrote an RC4 algorithm in…

fdmillion
- 4,823
- 7
- 45
- 82
1
vote
1 answer
How to use a set of numbers as the Key for RCA Encryption
i would like to know how can i use a set of numbers as a KEY for the rc4 encryption.
According to the internet and wiki the KEY is actually a string of letters but the bytes are used . But in my program i need to use a 6 digit number as a KEY.…

M.A
- 1,073
- 2
- 15
- 21
1
vote
3 answers
rc4 key recovery (2 messages, same partial key)
I have two messages that are encrypted with the same partial key. For example:
C1 = RC4(M1, "(VARIABLE_DATA)XXXXYYYY")
C2 = RC4(M2, "(VARIABLE_DATA)XXXXYYYY")
Is it possible with RC4, if C1 and C2 are known to atleast recover the partial key…

user974896
- 1,795
- 4
- 28
- 48