private byte[] SubByte(byte[] newKeyScheduler) { for (var i = 0; i < newKeyScheduler.Length; i++) { newKeyScheduler[i] = SBox.Replace(newKeyScheduler[i].ToString("X2")); } return(newKeyScheduler); }
public void SubBytes() { for (var i = 0; i < 4; i++) { for (var j = 0; j < 4; j++) { this.crifredText.matrix[i, j] = SBox.Replace(this.crifredText.matrix[i, j].ToString("X2")); } } }
public static byte Replace(string bte) { if (sboxSingleton == null) { SBox.sboxSingleton = new SBox(); } var byteStr = bte.ToCharArray(); return(SBox.sboxSingleton.sbox[Convert.ToInt32(byteStr[0].ToString(), 16), Convert.ToInt32(byteStr[1].ToString(), 16)]); }