Install virtualenv
sudo apt install virtualenv
Install virtualenvwrapper
| # # # # # # # # # # # # # # # # # # # # # # # # # # | |
| # Demonstration of CBC Bit Flipping Attack # | |
| # Author: Panos Sakkos <[email protected]> # | |
| # Date: October 2017 # | |
| # License: MIT # | |
| # # # # # # # # # # # # # # # # # # # # # # # # # # | |
| require 'openssl' | |
| class UnauthenticatedEncryption |
| const | |
| // Begining APDU command. "Payment System Environment (PSE)" 2pay.sys.ddf01 | |
| // The card should response with Application Identifier (AID) | |
| PPSE = '00 a4 04 00 0e 32 50 41 59 2e 53 59 53 2e 44 44 46 30 31 00'; | |
| // Application Identifier (AID) start command prefix | |
| // Possible AID's: | |
| // A0000000031010 Visa International | |
| // A0000000032020 Visa International | |
| // A0000000041010 Mastercard International |
| rm -v pub.pkcs8 test.sign test.txt.decrypted test.txt.encrypted |
| # Information in this script was obtained from public sources, and not under NDA with NXP. | |
| # GPShell style APDU commands, but you should be able to adapt it to anything that can send raw APDU's to the card | |
| # Our TK Key | |
| 00A4040010C238E449F725B1510EAA699550CABA16 | |
| # Reset card to factory defaults - THIS WILL WIPE OUT ALL APPLETS INSTALLED | |
| 00F00000 | |
| # Set the Card to use T=1 transmission mode |
| pragma solidity ^0.5.16; | |
| import "../openzeppelin-contracts/GSN/Context.sol"; | |
| import "../openzeppelin-contracts/token/ERC20/ERC20.sol"; | |
| import "../openzeppelin-contracts/token/ERC20/ERC20Detailed.sol"; | |
| import "../openzeppelin-contracts/math/SafeMath.sol"; | |
| contract BaseToken is Context, ERC20, ERC20Detailed { |
| pragma solidity ^0.5.11; | |
| import "../openzeppelin-contracts/GSN/Context.sol"; | |
| import "../openzeppelin-contracts/token/ERC20/ERC20.sol"; | |
| import "../openzeppelin-contracts/token/ERC20/ERC20Detailed.sol"; | |
| import "../openzeppelin-contracts/math/SafeMath.sol"; | |
| import "../openzeppelin-contracts/ownership/Ownable.sol"; | |
| contract BaseToken is |
| pragma solidity ^0.5.11; | |
| import "../openzeppelin-contracts/GSN/Context.sol"; | |
| import "../openzeppelin-contracts/token/ERC20/ERC20.sol"; | |
| import "../openzeppelin-contracts/token/ERC20/ERC20Detailed.sol"; | |
| import "../openzeppelin-contracts/math/SafeMath.sol"; | |
| contract NonPayable { |
| pragma solidity ^0.5.11; | |
| import "../openzeppelin-contracts/GSN/Context.sol"; | |
| import "../openzeppelin-contracts/token/ERC20/ERC20.sol"; | |
| import "../openzeppelin-contracts/token/ERC20/ERC20Detailed.sol"; | |
| import "../openzeppelin-contracts/math/SafeMath.sol"; | |
| contract BaseToken is Context, ERC20, ERC20Detailed { |