1 19 20 package com.maverick.ssl; 21 22 import com.maverick.crypto.engines.RC4Engine; 23 24 28 class SSL_RSA_WITH_RC4_128_MD5 extends SSLCipherSuiteWithMD5MAC { 29 30 RC4Engine encrypt; 31 RC4Engine decrypt; 32 33 public SSL_RSA_WITH_RC4_128_MD5() { 34 } 35 36 public void init(byte[] encryptKey, byte[] encryptIV, byte[] decryptKey, byte[] decryptIV) { 37 38 encrypt = new RC4Engine(); 39 encrypt.init(true, encryptKey); 40 41 decrypt = new RC4Engine(); 42 decrypt.init(false, decryptKey); 43 } 44 45 public int getKeyLength() { 46 return 16; 47 } 48 49 public int getIVLength() { 50 return 0; 51 } 52 53 public void encrypt(byte[] b, int offset, int len) { 54 encrypt.processBytes(b, offset, len, b, offset); 55 } 56 57 public void decrypt(byte[] b, int offset, int len) { 58 decrypt.processBytes(b, offset, len, b, offset); 59 } 60 61 } | Popular Tags |