public SARC4() { context = new EVP_CTX(); EVP_CIPHER_CTX_init(ref context); EVP_EncryptInit_ex(ref context, EVP_rc4(), IntPtr.Zero, null, null); EVP_CIPHER_CTX_set_key_length(ref context, 20); }
private static extern int EVP_EncryptUpdate(ref EVP_CTX ctx, [Out] byte[] outp, ref int outL, [In] byte[] inp, int inplen);
private static extern void EVP_EncryptInit_ex(ref EVP_CTX ctx, IntPtr Cipher, IntPtr Engine, byte[] key, byte[] iv);
private static extern int EVP_EncryptFinal_ex(ref EVP_CTX ctx, [Out] byte[] output, ref int outL);
private static extern int EVP_CIPHER_CTX_set_key_length(ref EVP_CTX ctx, int keylen);
private static extern void EVP_CIPHER_CTX_init(ref EVP_CTX ctx);
private static extern int EVP_CIPHER_CTX_cleanup(ref EVP_CTX ctx);