1IRK Calculator 2============== 3author: [email protected] 4 5This tool is used to verify an IRK + RPA pair and generate an RPA from an IRK. 6 7``` 8irk-calculator 0.1.0 9 10USAGE: 11 irk-calculator --command <COMMAND> --irk <IRK> --address <ADDRESS> 12 13OPTIONS: 14 -a, --address <ADDRESS> 15 -c, --command <COMMAND> 16 -h, --help Print help information 17 -i, --irk <IRK> 18 -V, --version Print version information 19``` 20 21``` 22Legend: 23 24IRK = Identity Resolving Key (see BT Spec for more) 25RPA = Resolvable Private Address (see BT spec for more) 26``` 27 28Example Data: 29 30``` 31IRK: 0102030405060708090a0b0c0d0e0f10 32RPA: 79:CB:92:70:BE:B3 33 34IRK: 0102030405060708090a0b0c0d0e0f10 35RPA: 58:9B:3E:A3:5B:24 36``` 37 38Example Usage: 39 40``` 41$ cargo build && RUST_BACKTRACE=1 ./target/debug/irk-calculator -c verify -a "79:CB:92:70:BE:B3" -i "0102030405060708090a0b0c0d0e0f10" 42 Verifying 0102030405060708090a0b0c0d0e0f10 and 79:CB:92:70:BE:B3 43 IRK Byte Array: [01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 10] 44 Address Byte Array: [79, CB, 92, 70, BE, B3] 45 prand: [79, CB, 92] 46 Given Hash: [70, BE, B3] 47 irk slice: [01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 10] 48 =====[ ah ]===== 49 K: [01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 10] 50 R: [79, CB, 92] 51 R': [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 79, CB, 92] 52 =====[ e ]===== 53 key_reversed: [10, 0F, 0E, 0D, 0C, 0B, 0A, 09, 08, 07, 06, 05, 04, 03, 02, 01] 54 block: [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 79, CB, 92] 55 e-block: [05, 5A, 53, 46, BB, 26, 28, 67, AC, 24, 73, 66, 41, 70, BE, B3] 56 =====[ /e ]===== 57 ED: [05, 5A, 53, 46, BB, 26, 28, 67, AC, 24, 73, 66, 41, 70, BE, B3] 58 ret: [70, BE, B3] 59 =====[ /ah ]===== 60 given hash: [70, BE, B3] 61 calcd hash: [70, BE, B3] 62 IRK + Address combination is valid: true 63 64$ cargo build && RUST_BACKTRACE=1 ./target/debug/irk-calculator -c verify -a "58:9B:3E:A3:5B:24" -i "0102030405060708090a0b0c0d0e0f10" 65 Verifying 0102030405060708090a0b0c0d0e0f10 and 58:9B:3E:A3:5B:24 66 IRK Byte Array: [01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 10] 67 Address Byte Array: [58, 9B, 3E, A3, 5B, 24] 68 prand: [58, 9B, 3E] 69 Given Hash: [A3, 5B, 24] 70 irk slice: [01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 10] 71 =====[ ah ]===== 72 K: [01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 10] 73 R: [58, 9B, 3E] 74 R': [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 58, 9B, 3E] 75 =====[ e ]===== 76 key_reversed: [10, 0F, 0E, 0D, 0C, 0B, 0A, 09, 08, 07, 06, 05, 04, 03, 02, 01] 77 block: [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 58, 9B, 3E] 78 e-block: [A9, EC, 77, CE, BB, BC, 24, A7, 45, 1E, 5E, 23, F7, A3, 5B, 24] 79 =====[ /e ]===== 80 ED: [A9, EC, 77, CE, BB, BC, 24, A7, 45, 1E, 5E, 23, F7, A3, 5B, 24] 81 ret: [A3, 5B, 24] 82 =====[ /ah ]===== 83 given hash: [A3, 5B, 24] 84 calcd hash: [A3, 5B, 24] 85 IRK + Address combination is valid: true 86``` 87