- カスカ 懐石・研究 38枚目
623 :名無しさん@編集中[sage]:2014/09/15(月) 23:50:07.46 ID:uchHvn04 - あとはプロトコル4XのMAC生成コード書くだけでいいんだけど
焼きそばソースではswitch文使ってある上に フォールスルーもあるようなので 氷砂糖なめながらどう書き直そうか試行中 http://i.imgur.com/wcHbMPx.png 明日までには公開するけど 大体こんな感じで使えるようにする byte[] key = new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF }; byte[] plainText = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }; byte protocol = 0x00; BCAS cipher = new BCAS(protocol, key); BlockCipherOperator64 bcasOperator = new BlockCipherOperator64(cipher, EndiannessBitConverter.Endian.Big, EndiannessBitConverter.Endian.Big); byte[] cipherText = bcasOperator.EncryptECB(plainText); byte[] decryptedPlainText = bcasOperator.DecryptECB(cipherText); byte[] messageAuthenticationCode = cipher.MessageAuthenticationCode(plainText, EndiannessBitConverter.Endian.Big, EndiannessBitConverter.Endian.Big);
|