Last active
March 19, 2019 04:49
-
-
Save colinoflynn/67aa21f407bfeefb84035bf0abfef027 to your computer and use it in GitHub Desktop.
Simple Fault Example.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"name": "Simple Fault Example.ipynb", | |
"version": "0.3.2", | |
"provenance": [], | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/colinoflynn/67aa21f407bfeefb84035bf0abfef027/simple-fault-example.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"metadata": { | |
"id": "AkT4JIBlLifw", | |
"colab_type": "text" | |
}, | |
"cell_type": "markdown", | |
"source": [ | |
"#Part 1: Setup#\n", | |
"\n", | |
"As an initial step - let's simply define an AES implementation. You'll need to run the following code block:" | |
] | |
}, | |
{ | |
"metadata": { | |
"id": "5GD0XHd-Lq4T", | |
"colab_type": "code", | |
"colab": {} | |
}, | |
"cell_type": "code", | |
"source": [ | |
"_sbox=(\n", | |
"0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76,\n", | |
"0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0,0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0,\n", | |
"0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc,0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15,\n", | |
"0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a,0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75,\n", | |
"0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0,0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84,\n", | |
"0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b,0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf,\n", | |
"0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85,0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8,\n", | |
"0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5,0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2,\n", | |
"0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17,0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73,\n", | |
"0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88,0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb,\n", | |
"0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c,0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79,\n", | |
"0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9,0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08,\n", | |
"0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6,0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a,\n", | |
"0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e,0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e,\n", | |
"0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94,0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf,\n", | |
"0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68,0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16)\n", | |
"\n", | |
"_gal1=tuple(range(256))\n", | |
"_gal2=(\n", | |
"0x00,0x02,0x04,0x06,0x08,0x0a,0x0c,0x0e,0x10,0x12,0x14,0x16,0x18,0x1a,0x1c,0x1e,\n", | |
"0x20,0x22,0x24,0x26,0x28,0x2a,0x2c,0x2e,0x30,0x32,0x34,0x36,0x38,0x3a,0x3c,0x3e,\n", | |
"0x40,0x42,0x44,0x46,0x48,0x4a,0x4c,0x4e,0x50,0x52,0x54,0x56,0x58,0x5a,0x5c,0x5e,\n", | |
"0x60,0x62,0x64,0x66,0x68,0x6a,0x6c,0x6e,0x70,0x72,0x74,0x76,0x78,0x7a,0x7c,0x7e,\n", | |
"0x80,0x82,0x84,0x86,0x88,0x8a,0x8c,0x8e,0x90,0x92,0x94,0x96,0x98,0x9a,0x9c,0x9e,\n", | |
"0xa0,0xa2,0xa4,0xa6,0xa8,0xaa,0xac,0xae,0xb0,0xb2,0xb4,0xb6,0xb8,0xba,0xbc,0xbe,\n", | |
"0xc0,0xc2,0xc4,0xc6,0xc8,0xca,0xcc,0xce,0xd0,0xd2,0xd4,0xd6,0xd8,0xda,0xdc,0xde,\n", | |
"0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xee,0xf0,0xf2,0xf4,0xf6,0xf8,0xfa,0xfc,0xfe,\n", | |
"0x1b,0x19,0x1f,0x1d,0x13,0x11,0x17,0x15,0x0b,0x09,0x0f,0x0d,0x03,0x01,0x07,0x05,\n", | |
"0x3b,0x39,0x3f,0x3d,0x33,0x31,0x37,0x35,0x2b,0x29,0x2f,0x2d,0x23,0x21,0x27,0x25,\n", | |
"0x5b,0x59,0x5f,0x5d,0x53,0x51,0x57,0x55,0x4b,0x49,0x4f,0x4d,0x43,0x41,0x47,0x45,\n", | |
"0x7b,0x79,0x7f,0x7d,0x73,0x71,0x77,0x75,0x6b,0x69,0x6f,0x6d,0x63,0x61,0x67,0x65,\n", | |
"0x9b,0x99,0x9f,0x9d,0x93,0x91,0x97,0x95,0x8b,0x89,0x8f,0x8d,0x83,0x81,0x87,0x85,\n", | |
"0xbb,0xb9,0xbf,0xbd,0xb3,0xb1,0xb7,0xb5,0xab,0xa9,0xaf,0xad,0xa3,0xa1,0xa7,0xa5,\n", | |
"0xdb,0xd9,0xdf,0xdd,0xd3,0xd1,0xd7,0xd5,0xcb,0xc9,0xcf,0xcd,0xc3,0xc1,0xc7,0xc5,\n", | |
"0xfb,0xf9,0xff,0xfd,0xf3,0xf1,0xf7,0xf5,0xeb,0xe9,0xef,0xed,0xe3,0xe1,0xe7,0xe5)\n", | |
"_gal3=(\n", | |
"0x00,0x03,0x06,0x05,0x0c,0x0f,0x0a,0x09,0x18,0x1b,0x1e,0x1d,0x14,0x17,0x12,0x11,\n", | |
"0x30,0x33,0x36,0x35,0x3c,0x3f,0x3a,0x39,0x28,0x2b,0x2e,0x2d,0x24,0x27,0x22,0x21,\n", | |
"0x60,0x63,0x66,0x65,0x6c,0x6f,0x6a,0x69,0x78,0x7b,0x7e,0x7d,0x74,0x77,0x72,0x71,\n", | |
"0x50,0x53,0x56,0x55,0x5c,0x5f,0x5a,0x59,0x48,0x4b,0x4e,0x4d,0x44,0x47,0x42,0x41,\n", | |
"0xc0,0xc3,0xc6,0xc5,0xcc,0xcf,0xca,0xc9,0xd8,0xdb,0xde,0xdd,0xd4,0xd7,0xd2,0xd1,\n", | |
"0xf0,0xf3,0xf6,0xf5,0xfc,0xff,0xfa,0xf9,0xe8,0xeb,0xee,0xed,0xe4,0xe7,0xe2,0xe1,\n", | |
"0xa0,0xa3,0xa6,0xa5,0xac,0xaf,0xaa,0xa9,0xb8,0xbb,0xbe,0xbd,0xb4,0xb7,0xb2,0xb1,\n", | |
"0x90,0x93,0x96,0x95,0x9c,0x9f,0x9a,0x99,0x88,0x8b,0x8e,0x8d,0x84,0x87,0x82,0x81,\n", | |
"0x9b,0x98,0x9d,0x9e,0x97,0x94,0x91,0x92,0x83,0x80,0x85,0x86,0x8f,0x8c,0x89,0x8a,\n", | |
"0xab,0xa8,0xad,0xae,0xa7,0xa4,0xa1,0xa2,0xb3,0xb0,0xb5,0xb6,0xbf,0xbc,0xb9,0xba,\n", | |
"0xfb,0xf8,0xfd,0xfe,0xf7,0xf4,0xf1,0xf2,0xe3,0xe0,0xe5,0xe6,0xef,0xec,0xe9,0xea,\n", | |
"0xcb,0xc8,0xcd,0xce,0xc7,0xc4,0xc1,0xc2,0xd3,0xd0,0xd5,0xd6,0xdf,0xdc,0xd9,0xda,\n", | |
"0x5b,0x58,0x5d,0x5e,0x57,0x54,0x51,0x52,0x43,0x40,0x45,0x46,0x4f,0x4c,0x49,0x4a,\n", | |
"0x6b,0x68,0x6d,0x6e,0x67,0x64,0x61,0x62,0x73,0x70,0x75,0x76,0x7f,0x7c,0x79,0x7a,\n", | |
"0x3b,0x38,0x3d,0x3e,0x37,0x34,0x31,0x32,0x23,0x20,0x25,0x26,0x2f,0x2c,0x29,0x2a,\n", | |
"0x0b,0x08,0x0d,0x0e,0x07,0x04,0x01,0x02,0x13,0x10,0x15,0x16,0x1f,0x1c,0x19,0x1a)\n", | |
"_gal9=(\n", | |
"0x00,0x09,0x12,0x1b,0x24,0x2d,0x36,0x3f,0x48,0x41,0x5a,0x53,0x6c,0x65,0x7e,0x77,\n", | |
"0x90,0x99,0x82,0x8b,0xb4,0xbd,0xa6,0xaf,0xd8,0xd1,0xca,0xc3,0xfc,0xf5,0xee,0xe7,\n", | |
"0x3b,0x32,0x29,0x20,0x1f,0x16,0x0d,0x04,0x73,0x7a,0x61,0x68,0x57,0x5e,0x45,0x4c,\n", | |
"0xab,0xa2,0xb9,0xb0,0x8f,0x86,0x9d,0x94,0xe3,0xea,0xf1,0xf8,0xc7,0xce,0xd5,0xdc,\n", | |
"0x76,0x7f,0x64,0x6d,0x52,0x5b,0x40,0x49,0x3e,0x37,0x2c,0x25,0x1a,0x13,0x08,0x01,\n", | |
"0xe6,0xef,0xf4,0xfd,0xc2,0xcb,0xd0,0xd9,0xae,0xa7,0xbc,0xb5,0x8a,0x83,0x98,0x91,\n", | |
"0x4d,0x44,0x5f,0x56,0x69,0x60,0x7b,0x72,0x05,0x0c,0x17,0x1e,0x21,0x28,0x33,0x3a,\n", | |
"0xdd,0xd4,0xcf,0xc6,0xf9,0xf0,0xeb,0xe2,0x95,0x9c,0x87,0x8e,0xb1,0xb8,0xa3,0xaa,\n", | |
"0xec,0xe5,0xfe,0xf7,0xc8,0xc1,0xda,0xd3,0xa4,0xad,0xb6,0xbf,0x80,0x89,0x92,0x9b,\n", | |
"0x7c,0x75,0x6e,0x67,0x58,0x51,0x4a,0x43,0x34,0x3d,0x26,0x2f,0x10,0x19,0x02,0x0b,\n", | |
"0xd7,0xde,0xc5,0xcc,0xf3,0xfa,0xe1,0xe8,0x9f,0x96,0x8d,0x84,0xbb,0xb2,0xa9,0xa0,\n", | |
"0x47,0x4e,0x55,0x5c,0x63,0x6a,0x71,0x78,0x0f,0x06,0x1d,0x14,0x2b,0x22,0x39,0x30,\n", | |
"0x9a,0x93,0x88,0x81,0xbe,0xb7,0xac,0xa5,0xd2,0xdb,0xc0,0xc9,0xf6,0xff,0xe4,0xed,\n", | |
"0x0a,0x03,0x18,0x11,0x2e,0x27,0x3c,0x35,0x42,0x4b,0x50,0x59,0x66,0x6f,0x74,0x7d,\n", | |
"0xa1,0xa8,0xb3,0xba,0x85,0x8c,0x97,0x9e,0xe9,0xe0,0xfb,0xf2,0xcd,0xc4,0xdf,0xd6,\n", | |
"0x31,0x38,0x23,0x2a,0x15,0x1c,0x07,0x0e,0x79,0x70,0x6b,0x62,0x5d,0x54,0x4f,0x46)\n", | |
"_gal11=(\n", | |
"0x00,0x0b,0x16,0x1d,0x2c,0x27,0x3a,0x31,0x58,0x53,0x4e,0x45,0x74,0x7f,0x62,0x69,\n", | |
"0xb0,0xbb,0xa6,0xad,0x9c,0x97,0x8a,0x81,0xe8,0xe3,0xfe,0xf5,0xc4,0xcf,0xd2,0xd9,\n", | |
"0x7b,0x70,0x6d,0x66,0x57,0x5c,0x41,0x4a,0x23,0x28,0x35,0x3e,0x0f,0x04,0x19,0x12,\n", | |
"0xcb,0xc0,0xdd,0xd6,0xe7,0xec,0xf1,0xfa,0x93,0x98,0x85,0x8e,0xbf,0xb4,0xa9,0xa2,\n", | |
"0xf6,0xfd,0xe0,0xeb,0xda,0xd1,0xcc,0xc7,0xae,0xa5,0xb8,0xb3,0x82,0x89,0x94,0x9f,\n", | |
"0x46,0x4d,0x50,0x5b,0x6a,0x61,0x7c,0x77,0x1e,0x15,0x08,0x03,0x32,0x39,0x24,0x2f,\n", | |
"0x8d,0x86,0x9b,0x90,0xa1,0xaa,0xb7,0xbc,0xd5,0xde,0xc3,0xc8,0xf9,0xf2,0xef,0xe4,\n", | |
"0x3d,0x36,0x2b,0x20,0x11,0x1a,0x07,0x0c,0x65,0x6e,0x73,0x78,0x49,0x42,0x5f,0x54,\n", | |
"0xf7,0xfc,0xe1,0xea,0xdb,0xd0,0xcd,0xc6,0xaf,0xa4,0xb9,0xb2,0x83,0x88,0x95,0x9e,\n", | |
"0x47,0x4c,0x51,0x5a,0x6b,0x60,0x7d,0x76,0x1f,0x14,0x09,0x02,0x33,0x38,0x25,0x2e,\n", | |
"0x8c,0x87,0x9a,0x91,0xa0,0xab,0xb6,0xbd,0xd4,0xdf,0xc2,0xc9,0xf8,0xf3,0xee,0xe5,\n", | |
"0x3c,0x37,0x2a,0x21,0x10,0x1b,0x06,0x0d,0x64,0x6f,0x72,0x79,0x48,0x43,0x5e,0x55,\n", | |
"0x01,0x0a,0x17,0x1c,0x2d,0x26,0x3b,0x30,0x59,0x52,0x4f,0x44,0x75,0x7e,0x63,0x68,\n", | |
"0xb1,0xba,0xa7,0xac,0x9d,0x96,0x8b,0x80,0xe9,0xe2,0xff,0xf4,0xc5,0xce,0xd3,0xd8,\n", | |
"0x7a,0x71,0x6c,0x67,0x56,0x5d,0x40,0x4b,0x22,0x29,0x34,0x3f,0x0e,0x05,0x18,0x13,\n", | |
"0xca,0xc1,0xdc,0xd7,0xe6,0xed,0xf0,0xfb,0x92,0x99,0x84,0x8f,0xbe,0xb5,0xa8,0xa3)\n", | |
"_gal13=(\n", | |
"0x00,0x0d,0x1a,0x17,0x34,0x39,0x2e,0x23,0x68,0x65,0x72,0x7f,0x5c,0x51,0x46,0x4b,\n", | |
"0xd0,0xdd,0xca,0xc7,0xe4,0xe9,0xfe,0xf3,0xb8,0xb5,0xa2,0xaf,0x8c,0x81,0x96,0x9b,\n", | |
"0xbb,0xb6,0xa1,0xac,0x8f,0x82,0x95,0x98,0xd3,0xde,0xc9,0xc4,0xe7,0xea,0xfd,0xf0,\n", | |
"0x6b,0x66,0x71,0x7c,0x5f,0x52,0x45,0x48,0x03,0x0e,0x19,0x14,0x37,0x3a,0x2d,0x20,\n", | |
"0x6d,0x60,0x77,0x7a,0x59,0x54,0x43,0x4e,0x05,0x08,0x1f,0x12,0x31,0x3c,0x2b,0x26,\n", | |
"0xbd,0xb0,0xa7,0xaa,0x89,0x84,0x93,0x9e,0xd5,0xd8,0xcf,0xc2,0xe1,0xec,0xfb,0xf6,\n", | |
"0xd6,0xdb,0xcc,0xc1,0xe2,0xef,0xf8,0xf5,0xbe,0xb3,0xa4,0xa9,0x8a,0x87,0x90,0x9d,\n", | |
"0x06,0x0b,0x1c,0x11,0x32,0x3f,0x28,0x25,0x6e,0x63,0x74,0x79,0x5a,0x57,0x40,0x4d,\n", | |
"0xda,0xd7,0xc0,0xcd,0xee,0xe3,0xf4,0xf9,0xb2,0xbf,0xa8,0xa5,0x86,0x8b,0x9c,0x91,\n", | |
"0x0a,0x07,0x10,0x1d,0x3e,0x33,0x24,0x29,0x62,0x6f,0x78,0x75,0x56,0x5b,0x4c,0x41,\n", | |
"0x61,0x6c,0x7b,0x76,0x55,0x58,0x4f,0x42,0x09,0x04,0x13,0x1e,0x3d,0x30,0x27,0x2a,\n", | |
"0xb1,0xbc,0xab,0xa6,0x85,0x88,0x9f,0x92,0xd9,0xd4,0xc3,0xce,0xed,0xe0,0xf7,0xfa,\n", | |
"0xb7,0xba,0xad,0xa0,0x83,0x8e,0x99,0x94,0xdf,0xd2,0xc5,0xc8,0xeb,0xe6,0xf1,0xfc,\n", | |
"0x67,0x6a,0x7d,0x70,0x53,0x5e,0x49,0x44,0x0f,0x02,0x15,0x18,0x3b,0x36,0x21,0x2c,\n", | |
"0x0c,0x01,0x16,0x1b,0x38,0x35,0x22,0x2f,0x64,0x69,0x7e,0x73,0x50,0x5d,0x4a,0x47,\n", | |
"0xdc,0xd1,0xc6,0xcb,0xe8,0xe5,0xf2,0xff,0xb4,0xb9,0xae,0xa3,0x80,0x8d,0x9a,0x97)\n", | |
"_gal14=(\n", | |
"0x00,0x0e,0x1c,0x12,0x38,0x36,0x24,0x2a,0x70,0x7e,0x6c,0x62,0x48,0x46,0x54,0x5a,\n", | |
"0xe0,0xee,0xfc,0xf2,0xd8,0xd6,0xc4,0xca,0x90,0x9e,0x8c,0x82,0xa8,0xa6,0xb4,0xba,\n", | |
"0xdb,0xd5,0xc7,0xc9,0xe3,0xed,0xff,0xf1,0xab,0xa5,0xb7,0xb9,0x93,0x9d,0x8f,0x81,\n", | |
"0x3b,0x35,0x27,0x29,0x03,0x0d,0x1f,0x11,0x4b,0x45,0x57,0x59,0x73,0x7d,0x6f,0x61,\n", | |
"0xad,0xa3,0xb1,0xbf,0x95,0x9b,0x89,0x87,0xdd,0xd3,0xc1,0xcf,0xe5,0xeb,0xf9,0xf7,\n", | |
"0x4d,0x43,0x51,0x5f,0x75,0x7b,0x69,0x67,0x3d,0x33,0x21,0x2f,0x05,0x0b,0x19,0x17,\n", | |
"0x76,0x78,0x6a,0x64,0x4e,0x40,0x52,0x5c,0x06,0x08,0x1a,0x14,0x3e,0x30,0x22,0x2c,\n", | |
"0x96,0x98,0x8a,0x84,0xae,0xa0,0xb2,0xbc,0xe6,0xe8,0xfa,0xf4,0xde,0xd0,0xc2,0xcc,\n", | |
"0x41,0x4f,0x5d,0x53,0x79,0x77,0x65,0x6b,0x31,0x3f,0x2d,0x23,0x09,0x07,0x15,0x1b,\n", | |
"0xa1,0xaf,0xbd,0xb3,0x99,0x97,0x85,0x8b,0xd1,0xdf,0xcd,0xc3,0xe9,0xe7,0xf5,0xfb,\n", | |
"0x9a,0x94,0x86,0x88,0xa2,0xac,0xbe,0xb0,0xea,0xe4,0xf6,0xf8,0xd2,0xdc,0xce,0xc0,\n", | |
"0x7a,0x74,0x66,0x68,0x42,0x4c,0x5e,0x50,0x0a,0x04,0x16,0x18,0x32,0x3c,0x2e,0x20,\n", | |
"0xec,0xe2,0xf0,0xfe,0xd4,0xda,0xc8,0xc6,0x9c,0x92,0x80,0x8e,0xa4,0xaa,0xb8,0xb6,\n", | |
"0x0c,0x02,0x10,0x1e,0x34,0x3a,0x28,0x26,0x7c,0x72,0x60,0x6e,0x44,0x4a,0x58,0x56,\n", | |
"0x37,0x39,0x2b,0x25,0x0f,0x01,0x13,0x1d,0x47,0x49,0x5b,0x55,0x7f,0x71,0x63,0x6d,\n", | |
"0xd7,0xd9,0xcb,0xc5,0xef,0xe1,0xf3,0xfd,0xa7,0xa9,0xbb,0xb5,0x9f,0x91,0x83,0x8d)\n", | |
"_galI=_gal14,_gal11,_gal13,_gal9\n", | |
"_galNI=_gal2,_gal3,_gal1,_gal1\n", | |
"\n", | |
"def _mixcolumn (column, inverse):\n", | |
" #Use galois lookup tables instead of performing complicated operations\n", | |
" #If inverse, use matrix with inverse values\n", | |
" g0,g1,g2,g3=_galI if inverse else _galNI\n", | |
" c0,c1,c2,c3=column\n", | |
" return (\n", | |
" g0[c0]^g1[c1]^g2[c2]^g3[c3],\n", | |
" g3[c0]^g0[c1]^g1[c2]^g2[c3],\n", | |
" g2[c0]^g3[c1]^g0[c2]^g1[c3],\n", | |
" g1[c0]^g2[c1]^g3[c2]^g0[c3])\n", | |
"\n", | |
"\n", | |
"def _mixcolumns (state, inverse):\n", | |
" # Perform mix_column for each column in the state\n", | |
" for i, j in (0, 4), (4, 8), (8, 12), (12, 16):\n", | |
" state[i:j] = _mixcolumn(state[i:j], inverse)\n", | |
" return state\n", | |
"\n", | |
"def _shiftrow (row, shift):\n", | |
" #Circular shift row left by shift amount\n", | |
" row+=row[:shift]\n", | |
" del row[:shift]\n", | |
" return row\n", | |
" \n", | |
"def subbytes(inp):\n", | |
" return [sbox(i) for i in inp]\n", | |
" \n", | |
"def mixcolumns(state):\n", | |
" return _mixcolumns(state, False)\n", | |
"\n", | |
"def shiftrows (state):\n", | |
" #Extract rows as every 4th item starting at [1..3]\n", | |
" #Replace row with shift_row operation\n", | |
" for i in 1,2,3:\n", | |
" state[i::4] = _shiftrow(state[i::4],i)\n", | |
" return state\n", | |
" \n", | |
" \n", | |
"def sbox(inp):\n", | |
" s = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67,\n", | |
" 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59,\n", | |
" 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7,\n", | |
" 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1,\n", | |
" 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05,\n", | |
" 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83,\n", | |
" 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29,\n", | |
" 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b,\n", | |
" 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa,\n", | |
" 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c,\n", | |
" 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc,\n", | |
" 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec,\n", | |
" 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19,\n", | |
" 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee,\n", | |
" 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49,\n", | |
" 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,\n", | |
" 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4,\n", | |
" 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6,\n", | |
" 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70,\n", | |
" 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9,\n", | |
" 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e,\n", | |
" 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1,\n", | |
" 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0,\n", | |
" 0x54, 0xbb, 0x16]\n", | |
" return s[inp]\n", | |
"\n", | |
"\n", | |
"def invsbox(inp):\n", | |
" s = [0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3,\n", | |
" 0x9e, 0x81, 0xf3, 0xd7, 0xfb , 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f,\n", | |
" 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb , 0x54,\n", | |
" 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b,\n", | |
" 0x42, 0xfa, 0xc3, 0x4e , 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24,\n", | |
" 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25 , 0x72, 0xf8,\n", | |
" 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d,\n", | |
" 0x65, 0xb6, 0x92 , 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda,\n", | |
" 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84 , 0x90, 0xd8, 0xab,\n", | |
" 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3,\n", | |
" 0x45, 0x06 , 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1,\n", | |
" 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b , 0x3a, 0x91, 0x11, 0x41,\n", | |
" 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6,\n", | |
" 0x73 , 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9,\n", | |
" 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e , 0x47, 0xf1, 0x1a, 0x71, 0x1d,\n", | |
" 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b ,\n", | |
" 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0,\n", | |
" 0xfe, 0x78, 0xcd, 0x5a, 0xf4 , 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07,\n", | |
" 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f , 0x60,\n", | |
" 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f,\n", | |
" 0x93, 0xc9, 0x9c, 0xef , 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5,\n", | |
" 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61 , 0x17, 0x2b,\n", | |
" 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55,\n", | |
" 0x21, 0x0c, 0x7d]\n", | |
" return s[inp]\n", | |
"\n", | |
"\n", | |
"rcon = [0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36,\n", | |
" 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97,\n", | |
" 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72,\n", | |
" 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66,\n", | |
" 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04,\n", | |
" 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d,\n", | |
" 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3,\n", | |
" 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61,\n", | |
" 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a,\n", | |
" 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40,\n", | |
" 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc,\n", | |
" 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5,\n", | |
" 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a,\n", | |
" 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d,\n", | |
" 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c,\n", | |
" 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35,\n", | |
" 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4,\n", | |
" 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc,\n", | |
" 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08,\n", | |
" 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a,\n", | |
" 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d,\n", | |
" 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2,\n", | |
" 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74,\n", | |
" 0xe8, 0xcb ]\n", | |
"\n", | |
"\n", | |
"def g_func(inp, rcon):\n", | |
" #Step 1: change order\n", | |
" newlist = [inp[1], inp[2], inp[3], inp[0]]\n", | |
"\n", | |
" #Step 2: s-box\n", | |
" newlist = [sbox(t) for t in newlist]\n", | |
"\n", | |
" #Step 3: apply rcon\n", | |
" newlist[0] ^= rcon\n", | |
"\n", | |
" return newlist\n", | |
"\n", | |
"\n", | |
"def h_func(inp):\n", | |
" #Step 1: s-box\n", | |
" newlist = [sbox(t) for t in inp]\n", | |
"\n", | |
" return newlist\n", | |
"\n", | |
"\n", | |
"def xor(l1, l2):\n", | |
" return [l1[i] ^ l2[i] for i in range(0, len(l1))]\n", | |
"\n", | |
"\n", | |
"def keyScheduleRounds(inputkey, inputround, desiredround):\n", | |
" \"\"\"\n", | |
" inputkey = starting key, 16/32 bytes\n", | |
" inputround = starting round number (i.e. 0 = first)\n", | |
" desiredround = desired round number (i.e. 10 = last for 16-byte)\n", | |
" returns desired round number. Can go forward or backwards.\n", | |
" When dealing with AES-256, inputkey is 16 bytes and inputround\n", | |
" indicates round that bytes 0...15 are from.\n", | |
" \"\"\"\n", | |
"\n", | |
" #Some constants\n", | |
" n = len(inputkey)\n", | |
" if n == 16:\n", | |
" pass\n", | |
" elif n == 32:\n", | |
" desiredfull = desiredround\n", | |
" desiredround = int(desiredround / 2)\n", | |
"\n", | |
" #Special case for inputround of 13, needed for 'final' round...\n", | |
" if inputround != 13:\n", | |
" if inputround % 2 == 1:\n", | |
" raise ValueError(\"Input round must be divisible by 2\")\n", | |
" inputround = int(inputround / 2)\n", | |
" else:\n", | |
" if inputround <= desiredfull:\n", | |
" if desiredfull < 13:\n", | |
" raise ValueError(\"Round = 13 only permissible for reverse\")\n", | |
"\n", | |
" if desiredfull == 13:\n", | |
" return inputkey[0:16]\n", | |
" else:\n", | |
" return inputkey[16:32]\n", | |
"\n", | |
" else:\n", | |
" raise ValueError(\"Invalid keylength: %d\"%n)\n", | |
"\n", | |
" rnd = inputround\n", | |
" state = list(inputkey)\n", | |
"\n", | |
" #Check if we are going forward or backwards\n", | |
" while rnd < desiredround:\n", | |
" rnd += 1\n", | |
"\n", | |
" #Forward algorithm, thus need at least one round\n", | |
" state[0:4] = xor(state[0:4], g_func(state[(n-4):n], rcon[rnd]))\n", | |
" for i in range(4, n, 4):\n", | |
" if n == 32 and i == 16:\n", | |
" inp = h_func(state[(i-4):i])\n", | |
" else:\n", | |
" inp = state[(i - 4):i]\n", | |
" state[i:(i+4)] = xor(state[i:(i+4)], inp)\n", | |
"\n", | |
" while rnd > desiredround:\n", | |
" #For AES-256 final-round is 13 as that includes 32 bytes\n", | |
" #of key. Convert to round 12 then continue as usual...\n", | |
" if n == 32 and rnd == 13:\n", | |
" inputrnd = int(12/2)\n", | |
" rnd = inputrnd\n", | |
" oldstate = list(state[16:32])\n", | |
" state[16:32] = state[0:16]\n", | |
"\n", | |
" for i in range(12, 0, -4):\n", | |
" state[i:(i+4)] = xor(oldstate[i:(i+4)], oldstate[(i-4):i])\n", | |
" state[0:4] = xor(oldstate[0:4], g_func(state[(n - 4):n], rcon[7]))\n", | |
"\n", | |
" if rnd == desiredround:\n", | |
" break\n", | |
"\n", | |
" # Reverse algorithm, thus need at least one round\n", | |
" for i in range(n-4, 0, -4):\n", | |
" if n == 32 and i == 16:\n", | |
" inp = h_func(state[(i-4):i])\n", | |
" else:\n", | |
" inp = state[(i - 4):i]\n", | |
" state[i:(i+4)] = xor(state[i:(i+4)], inp)\n", | |
" state[0:4] = xor(state[0:4], g_func(state[(n - 4):n], rcon[rnd]))\n", | |
" rnd -= 1\n", | |
"\n", | |
" #For AES-256, we use half the generated key at once...\n", | |
" if n == 32:\n", | |
" if desiredfull % 2:\n", | |
" state = state[16:32]\n", | |
" else:\n", | |
" state = state[0:16]\n", | |
"\n", | |
" #Return answer\n", | |
" return state" | |
], | |
"execution_count": 0, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"id": "TFdd6ES5L9Rr", | |
"colab_type": "text" | |
}, | |
"cell_type": "markdown", | |
"source": [ | |
"#Part 2: Glitchy Cipher#\n", | |
"\n", | |
"The next thing we need to do is define a \"glitchy\" cipher. The following cipher assumes a very strong fault model - that we can directly control a bit at some location of the cipher. We can force any bit to \"1\" is our attack model, as seen in the code like:\n", | |
"\n", | |
"state[byte] |= (1 << bit)" | |
] | |
}, | |
{ | |
"metadata": { | |
"id": "TzC3RO0kKehn", | |
"colab_type": "code", | |
"colab": {} | |
}, | |
"cell_type": "code", | |
"source": [ | |
"import numpy as np" | |
], | |
"execution_count": 0, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"id": "WxGaTWYbKiJh", | |
"colab_type": "code", | |
"colab": {} | |
}, | |
"cell_type": "code", | |
"source": [ | |
"def cipher_glitched(pt, k, g_bit = None):\n", | |
" \"\"\"\n", | |
" Encrypt the plaintext pt using the key k with AES-128 encryption\n", | |
" Also, force the single bit g_bit to 1 after the first key addition\n", | |
" See aes.py for sample usage\n", | |
" \"\"\"\n", | |
" Nr = 10\n", | |
" ks = [keyScheduleRounds(k, 0, r) for r in range(Nr+1)]\n", | |
" state = pt\n", | |
" state = [state[i] ^ ks[0][i] for i in range(16)]\n", | |
" if g_bit is not None and g_bit >= 0 and g_bit < 128:\n", | |
" byte = g_bit / 8\n", | |
" bit = g_bit % 8\n", | |
" byte = int(byte)\n", | |
" bit = int(bit)\n", | |
" state[byte] |= (1 << bit)\n", | |
" for r in range(1, Nr):\n", | |
" state = subbytes(state)\n", | |
" state = shiftrows(state)\n", | |
" state = mixcolumns(state)\n", | |
" state = [state[i] ^ ks[r][i] for i in range(16)]\n", | |
" state = subbytes(state)\n", | |
" state = shiftrows(state)\n", | |
" state = [state[i] ^ ks[Nr][i] for i in range(16)]\n", | |
" return state\n", | |
"\n", | |
"def printhex(x):\n", | |
" \"\"\"\n", | |
" Print the list x as a single hex string\n", | |
" Example: \n", | |
" Input: printhex([0x01, 0x02, 0xab, 0xff])\n", | |
" Output: \"0x0102abff\"\n", | |
" \"\"\"\n", | |
" print(\"0x\" + \"\".join([\"%02x\"%b for b in x]))" | |
], | |
"execution_count": 0, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"id": "TBOXBlFyMnhS", | |
"colab_type": "text" | |
}, | |
"cell_type": "markdown", | |
"source": [ | |
"How does this help us? While we do something simple - we glitch our cipher running. If the bit of the key was *already* '1', our glitch won't do anything. If the key bit was '0', then our glitch should change our output!\n", | |
"\n", | |
"First, let's define the input and output without a glitch inserted:" | |
] | |
}, | |
{ | |
"metadata": { | |
"id": "vEzh4crqNMOe", | |
"colab_type": "code", | |
"colab": { | |
"base_uri": "https://localhost:8080/", | |
"height": 119 | |
}, | |
"outputId": "defab28c-f149-46c7-f729-d7d51ddad740" | |
}, | |
"cell_type": "code", | |
"source": [ | |
"pt = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n", | |
" 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]\n", | |
"k = [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, \n", | |
" 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c]\n", | |
"ct = cipher_glitched(pt, k)\n", | |
"\n", | |
"print(\"Plaintext:\")\n", | |
"printhex(pt)\n", | |
"print(\"Key:\")\n", | |
"printhex(k)\n", | |
"print(\"Ciphertext:\")\n", | |
"printhex(ct)" | |
], | |
"execution_count": 10, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": [ | |
"Plaintext:\n", | |
"0x00000000000000000000000000000000\n", | |
"Key:\n", | |
"0x2b7e151628aed2a6abf7158809cf4f3c\n", | |
"Ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n" | |
], | |
"name": "stdout" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"id": "557WcUJtNaPm", | |
"colab_type": "text" | |
}, | |
"cell_type": "markdown", | |
"source": [ | |
"Finally - we simply attack perform a test of each single bit, one bit at a time:" | |
] | |
}, | |
{ | |
"metadata": { | |
"id": "-1saKpp7KipR", | |
"colab_type": "code", | |
"colab": { | |
"base_uri": "https://localhost:8080/", | |
"height": 10965 | |
}, | |
"outputId": "ad506c5d-3947-4909-8351-6fbab4a391ac" | |
}, | |
"cell_type": "code", | |
"source": [ | |
"k_attacked = [0x00] * 16\n", | |
"for byte in range(16):\n", | |
" for bit in range(8):\n", | |
" g = byte*8 + bit\n", | |
" ct_glitched = cipher_glitched(pt, k, g)\n", | |
" if ct_glitched == ct:\n", | |
" k_bit = 1\n", | |
" else:\n", | |
" k_bit = 0\n", | |
" k_attacked[byte] |= (k_bit << bit)\n", | |
"\n", | |
" print(\"Attacking bit %d:\" % g)\n", | |
" print(\"Glitched ciphertext:\")\n", | |
" printhex(ct_glitched)\n", | |
" print(\"Recovered bit: %d\" % k_bit)\n", | |
" print(\"\")\n", | |
"\n", | |
"print(\"Original key:\")\n", | |
"printhex(k)\n", | |
"print(\"Reconstructed key:\")\n", | |
"printhex(k_attacked)" | |
], | |
"execution_count": 11, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": [ | |
"Attacking bit 0:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 1:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 2:\n", | |
"Glitched ciphertext:\n", | |
"0xcda43d7c6c56b627a96930a1f0b9916b\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 3:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 4:\n", | |
"Glitched ciphertext:\n", | |
"0x898ee5c014f1f6abd4d6f7f688715998\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 5:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 6:\n", | |
"Glitched ciphertext:\n", | |
"0x5b80db3d31e1e38ac76642fe90324439\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 7:\n", | |
"Glitched ciphertext:\n", | |
"0xf6c71eedc3d99bb183cb5b8d1568e606\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 8:\n", | |
"Glitched ciphertext:\n", | |
"0xfdf3d9dfcd52350d21d5dcda578f3228\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 9:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 10:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 11:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 12:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 13:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 14:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 15:\n", | |
"Glitched ciphertext:\n", | |
"0x8915a6c7f4a5c53fa103dad52b28b0f8\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 16:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 17:\n", | |
"Glitched ciphertext:\n", | |
"0xfd29c39f21da95966c430f3b995e4c28\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 18:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 19:\n", | |
"Glitched ciphertext:\n", | |
"0x170bbd2ab8c9be4e942a7ff2ed37d2d9\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 20:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 21:\n", | |
"Glitched ciphertext:\n", | |
"0xe7003c3746e590b422fc85f580de2e4b\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 22:\n", | |
"Glitched ciphertext:\n", | |
"0x537006320e56425673e185cbc15c83d6\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 23:\n", | |
"Glitched ciphertext:\n", | |
"0xaf1b6ee8bc74e1482687af4c2f93dafa\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 24:\n", | |
"Glitched ciphertext:\n", | |
"0xdae602999b23f811a58d3bc784fc61a9\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 25:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 26:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 27:\n", | |
"Glitched ciphertext:\n", | |
"0x7f8052a436127a885f33752fd5d38612\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 28:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 29:\n", | |
"Glitched ciphertext:\n", | |
"0x5c25793f5fe50efc6e6e9f84b5ef2332\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 30:\n", | |
"Glitched ciphertext:\n", | |
"0x13fef8ad7273972af99d235955ed8692\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 31:\n", | |
"Glitched ciphertext:\n", | |
"0x9b2a44aa842d1e81976e070637d39e3f\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 32:\n", | |
"Glitched ciphertext:\n", | |
"0x8ea51345cc2bb09cddd11eb87e95cc1f\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 33:\n", | |
"Glitched ciphertext:\n", | |
"0x6eb708d408fbe69e6c090a6bcdb049c7\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 34:\n", | |
"Glitched ciphertext:\n", | |
"0x0565ee69132dab33bc44bceceab72d3e\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 35:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 36:\n", | |
"Glitched ciphertext:\n", | |
"0xf590eb02560b03352dc9ce99cdbb6f78\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 37:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 38:\n", | |
"Glitched ciphertext:\n", | |
"0x772e7334bfd3909389c7e7bc23190286\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 39:\n", | |
"Glitched ciphertext:\n", | |
"0xfa5822b7ac701a00b66072fd24b0fb3c\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 40:\n", | |
"Glitched ciphertext:\n", | |
"0x2e9aafafdb8d5b0e25bd87da75363887\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 41:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 42:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 43:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 44:\n", | |
"Glitched ciphertext:\n", | |
"0xe217445a6bab303d09ef055591596e6b\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 45:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 46:\n", | |
"Glitched ciphertext:\n", | |
"0xb9b6e19b48207dfc6d5d469747bb2f6a\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 47:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 48:\n", | |
"Glitched ciphertext:\n", | |
"0xf644566de02f529aa57d9a6064ac0ab6\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 49:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 50:\n", | |
"Glitched ciphertext:\n", | |
"0x4e6d5a7ee70582cdd55822d00abb5205\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 51:\n", | |
"Glitched ciphertext:\n", | |
"0xb02463c338fb2ca274c8a2a2682bc2a3\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 52:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 53:\n", | |
"Glitched ciphertext:\n", | |
"0xdf8db7cc0e07f285132ba31a5ae0b9bb\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 54:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 55:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 56:\n", | |
"Glitched ciphertext:\n", | |
"0xdc0a3bc38609c26f6f2a63a39cf7ee93\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 57:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 58:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 59:\n", | |
"Glitched ciphertext:\n", | |
"0x91db98af46511501f2f12abe0fdf0e5d\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 60:\n", | |
"Glitched ciphertext:\n", | |
"0x0b6c4a8d363c7daf64b13b1f09534e4c\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 61:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 62:\n", | |
"Glitched ciphertext:\n", | |
"0xa39219b923840668680228fe35002620\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 63:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 64:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 65:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 66:\n", | |
"Glitched ciphertext:\n", | |
"0x70e2a84399968f4b5c9c5efd07409f48\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 67:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 68:\n", | |
"Glitched ciphertext:\n", | |
"0x6a77b58deaa0a1efad5445c6b7358bde\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 69:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 70:\n", | |
"Glitched ciphertext:\n", | |
"0xfa177c1e91ca721134e7b5abf47b03a8\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 71:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 72:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 73:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 74:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 75:\n", | |
"Glitched ciphertext:\n", | |
"0x0355cef00679fa4a5b40075ca40ff56d\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 76:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 77:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 78:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 79:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 80:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 81:\n", | |
"Glitched ciphertext:\n", | |
"0xa10165e6bf3ba69bc171762d9bf4a2c6\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 82:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 83:\n", | |
"Glitched ciphertext:\n", | |
"0x2f9797516bbb8bf05179b6aa81977bc8\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 84:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 85:\n", | |
"Glitched ciphertext:\n", | |
"0x24656faec78860a98dc95dc082be4f65\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 86:\n", | |
"Glitched ciphertext:\n", | |
"0x71f2cafd766c2bae2306fdfcaae88b33\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 87:\n", | |
"Glitched ciphertext:\n", | |
"0xc36ca85a35726472fa28cfb55051b0d7\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 88:\n", | |
"Glitched ciphertext:\n", | |
"0x6791ab9e2faeedef478d0e7c254011ae\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 89:\n", | |
"Glitched ciphertext:\n", | |
"0x291263afcbb35a805c3fb5bf12fac9f8\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 90:\n", | |
"Glitched ciphertext:\n", | |
"0xdaace5274808ebae5c2300a03ecae4aa\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 91:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 92:\n", | |
"Glitched ciphertext:\n", | |
"0x728d1f800d2eb2c35cb161548c9fee66\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 93:\n", | |
"Glitched ciphertext:\n", | |
"0x935487d5c6f78ec51cc3cccdf1eb01d8\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 94:\n", | |
"Glitched ciphertext:\n", | |
"0xc81d7338f53fb5987a7734c274f4b9fd\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 95:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 96:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 97:\n", | |
"Glitched ciphertext:\n", | |
"0x4b01333a1a7ac2d01d9020679d2f397e\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 98:\n", | |
"Glitched ciphertext:\n", | |
"0xd54c0cae9383369217b563d7a3c7d507\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 99:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 100:\n", | |
"Glitched ciphertext:\n", | |
"0x3d0c0723dcd0c6c200fa04fff8e34b3e\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 101:\n", | |
"Glitched ciphertext:\n", | |
"0x11f2d6d32ae85a16aa16a7749348c0dd\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 102:\n", | |
"Glitched ciphertext:\n", | |
"0xfdde43cda4e0c3a29aa3b74b77fd15e1\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 103:\n", | |
"Glitched ciphertext:\n", | |
"0x7d73eca8f1dfe9ab26e203f885850e50\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 104:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 105:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 106:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 107:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 108:\n", | |
"Glitched ciphertext:\n", | |
"0x4ab6f26f4666575e590d17fe093db63b\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 109:\n", | |
"Glitched ciphertext:\n", | |
"0xd020d0d7a2a75b019d9115fe7e9b6f54\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 110:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 111:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 112:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 113:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 114:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 115:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 116:\n", | |
"Glitched ciphertext:\n", | |
"0x07344ce231b16b59ab71c8852698660e\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 117:\n", | |
"Glitched ciphertext:\n", | |
"0xc3c9ea7ec2a114c81be007e93f664bd2\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 118:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 119:\n", | |
"Glitched ciphertext:\n", | |
"0xa9e8bf19ea04b26aad0491ae6775e5b1\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 120:\n", | |
"Glitched ciphertext:\n", | |
"0x57127d4034b1bebfaef466b9c7726fc6\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 121:\n", | |
"Glitched ciphertext:\n", | |
"0x973f2ef34879e2027f1734303ff21f89\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 122:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 123:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 124:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 125:\n", | |
"Glitched ciphertext:\n", | |
"0x7df76b0c1ab899b33e42f047b91b546f\n", | |
"Recovered bit: 1\n", | |
"\n", | |
"Attacking bit 126:\n", | |
"Glitched ciphertext:\n", | |
"0x05e4bc4b76494fcb1ac64cda971a82c8\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Attacking bit 127:\n", | |
"Glitched ciphertext:\n", | |
"0x56eb8ff89c97f540da2aaea6e508d3b9\n", | |
"Recovered bit: 0\n", | |
"\n", | |
"Original key:\n", | |
"0x2b7e151628aed2a6abf7158809cf4f3c\n", | |
"Reconstructed key:\n", | |
"0x2b7e151628aed2a6abf7158809cf4f3c\n" | |
], | |
"name": "stdout" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"id": "Q97nYtaGKqf5", | |
"colab_type": "code", | |
"colab": {} | |
}, | |
"cell_type": "code", | |
"source": [ | |
"" | |
], | |
"execution_count": 0, | |
"outputs": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment