protected void PrepareKey(byte[] pass) { rnd = SteganographyProvider.PrepareISAAC(pass); for (int i = 0, isaac = 0; i < key.Length; i++, isaac++) { if (isaac >= ISAAC.SIZE) { isaac = 0; rnd.Isaac(); } key[i] = (byte)(key[i] ^ rnd.rsl[isaac]); } }
public override void ImprintData(byte[] data) { string pass = SteganographyProvider.AskPassword(); if (pass != null && pass.Length > 0) { PrepareKey(Encoding.UTF8.GetBytes(pass)); } for (int i = 0; i < data.Length; i++) { data[i] ^= key[i % key.Length]; } vector = data; image.RemoveNonCritical(); ImprintPNG(data); }