functiontest() externalviewreturns(address) { bytes32 hash =0xc1af4b94166cd32fc49b7b926cbb91ee421de2d04450e8ae57857b9b56ac7e53; uint8 v =0x1b; bytes32 r =0xe1077fb9321c187d8a43926896abac5455ce6add269e098f855ff059d6b846a3; bytes32 s =0x56320be5f6d79c4d0e5583d6b9a2e50fae78f1fb5ff0553541e69c66dae2b2f8;
// 進行竄改 // v: 0x1c // s: 0xa9cdf41a092863b2f1aa7c29465d1aef0c35eaeb4f584b067debc225f5538e49 v = v ==0x1b ? 0x1c : 0x1b; s =bytes32(uint(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141) -uint(s));
returnecrecover(hash , v, r, s); }
結果會發現,仍然能成功回傳相同的簽署者。所以在這個情況下簽章可能會被重複使用。例如修改之前文章的範例,以 s 作為檢驗簽章是否使用過: