RAW key generation in IOS with AES
- by sudheer
I am novice to the cryptography in ios . I got a requirement to convert android encryption code into IOS . Below is the android code part. I need that in IOS .
Can any one please help me out in this . I need this below android code in IOS.
private static byte[] getRawKey(byte[] seed) throws Exception {
KeyGenerator kgen = KeyGenerator.getInstance("AES");
SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");
sr.setSeed(seed);
kgen.init(256, sr);
SecretKey skey = kgen.generateKey();
byte[] raw = skey.getEncoded();
return raw;
}