rc4-cipher

RC4 doesn't work correctly with openssl command?

馋奶兔 提交于 2019-12-19 17:31:59
问题 I need to encode the result of a execution with RC4. Before to do the bash script, I'm testing how to crypt the data. I'm using the next command: echo -ne "test" | openssl rc4 -k test -nosalt -e -nopad | xxd And the output is: 0000000: bdb1 7f03 .... now, If I try to do the same with this online RC4 encoder http://www.fyneworks.com/encryption/rc4-encryption/index.asp the output is: DA EA 54 65 Different output, with the same data and same key?? Data: "test" key: "test" Also I checked with a

combined RC4 RSA encrypt/decrypt for long messages Javascript

我只是一个虾纸丫 提交于 2019-12-13 14:13:41
问题 NOTE: Yes, I understand there is a lot of code in this message, but you do encourage us to show prior research and how we've been trying. Let me preface this by saying, I am not interested in the security of this function. All I want is to encrypt and decrypt arbitrarily long messages using RSA. Usually to do this, the message is encrypted using a block cipher (such as AES) and encrypting the key with the RSA cipher. However, I am just trying to find the easiest way to encrypt/decrypt long

RC4 Safe to use plaintext as the key to encrypt itself?

给你一囗甜甜゛ 提交于 2019-12-11 06:22:26
问题 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? 回答1: This should be handled with a key generation algorithm like PBKDF2, which will allow you to securely generate a hash from your password in a way that is appropriate for password verification (which is what I assume you're doing). While it is possible to

Is there anything wrong with this RC4 encryption code in C#

假如想象 提交于 2019-12-07 16:39:37
问题 I am trying to listen to the Foxycart XML Datafeed in C# and running into an issue which boils down to encryption. In short, they send over their data as encoded and encrypted XML using RC4 encryption. To test, they have some (user submitted) sample code to test this with C#. I tried using this sample RC4 decryption code provided by one of the users but it doesn't seem to work and their support staff thinks its down with the C# RC4 algorithm. Since they are not C# experts, i figured i would

Is there anything wrong with this RC4 encryption code in C#

浪子不回头ぞ 提交于 2019-12-05 22:35:03
I am trying to listen to the Foxycart XML Datafeed in C# and running into an issue which boils down to encryption. In short, they send over their data as encoded and encrypted XML using RC4 encryption . To test, they have some (user submitted) sample code to test this with C# . I tried using this sample RC4 decryption code provided by one of the users but it doesn't seem to work and their support staff thinks its down with the C# RC4 algorithm. Since they are not C# experts, i figured i would ask here. Here is the post on the FoxyCart forum Anyway, here is the code that (tries to) simulate the

Is it RC4 or ARCFOUR? InvalidKeyException when using SecretKeySpec?

我是研究僧i 提交于 2019-12-03 21:54:41
I tried running my application on my pc, but I keep getting this thing. Is it possible that I'm missing some libraries? fabsam.crypto.CryptoException: java.security.InvalidKeyException: No installed provider supports this key: javax.crypto.spec.SecretKeySpec at fabsam.crypto.RC4Decoder.decode(RC4Decoder.java:37) ~[bin/:na] ... (skipped my projects stack trace) at java.lang.Thread.run(Thread.java:662) [na:1.6.0_25] Caused by: java.security.InvalidKeyException: No installed provider supports this key: javax.crypto.spec.SecretKeySpec at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6] at javax.crypto

RC4 encryption java

£可爱£侵袭症+ 提交于 2019-11-28 19:57:49
Hi there I am trying to implement the RC4 algorithm in Java. I found this code as an example that help me to understand the idea: public class RC4 { private int[] S = new int[256]; private int[] T = new int[256]; private int keylen; public RC4(byte[] key) throws Exception { if (key.length < 1 || key.length > 256) { throw new Exception("key must be between 1 and 256 bytes"); } else { keylen = key.length; for (int i = 0; i < 256; i++) { S[i] = i; T[i] = key[i % keylen]; } int j = 0; for (int i = 0; i < 256; i++) { j = (j + S[i] + T[i]) % 256; S[i] ^= S[j]; S[j] ^= S[i]; S[i] ^= S[j]; } } }

Convert python long/int to fixed size byte array

﹥>﹥吖頭↗ 提交于 2019-11-28 18:35:26
I'm trying to implement RC4 and DH key exchange in python. Problem is that I have no idea about how to convert the python long/int from the key exchange to the byte array I need for the RC4 implementation. Is there a simple way to convert a long to the required length byte array? Update : forgot to mention that the numbers I'm dealing with are 768 bit unsigned integers. I haven't done any benchmarks, but this recipe "works for me". The short version: use '%x' % val , then unhexlify the result. The devil is in the details, though, as unhexlify requires an even number of hex digits, which %x

RC4 encryption java

ぃ、小莉子 提交于 2019-11-27 20:41:35
问题 Hi there I am trying to implement the RC4 algorithm in Java. I found this code as an example that help me to understand the idea: public class RC4 { private int[] S = new int[256]; private int[] T = new int[256]; private int keylen; public RC4(byte[] key) throws Exception { if (key.length < 1 || key.length > 256) { throw new Exception("key must be between 1 and 256 bytes"); } else { keylen = key.length; for (int i = 0; i < 256; i++) { S[i] = i; T[i] = key[i % keylen]; } int j = 0; for (int i