diff options
author | rsiddharth <s@ricketyspace.net> | 2021-01-12 18:52:05 -0500 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2021-01-12 18:52:05 -0500 |
commit | 2c05dfb2204a23c1a19ccdf97b03ea599ea8951d (patch) | |
tree | d5ad2676943b0cb7e697e5861893538fb903b24e | |
parent | 66da349adc15d4de7e09093f19fcc8fc082233c6 (diff) |
lib: add OracleAESVarEncryptECB
For challenge 14. This will be used as the `AES-128-ECB` function.
-rw-r--r-- | lib/oracle.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/oracle.go b/lib/oracle.go index f117c98..a2e75aa 100644 --- a/lib/oracle.go +++ b/lib/oracle.go @@ -69,6 +69,12 @@ func OracleAESEncryptECB(in []byte) []byte { return AESEncryptECB(append(in, Base64ToBytes(oracleUnknown)...), oracleKey) } +func OracleAESVarEncryptECB(in []byte) []byte { + in = append(oracleRandom, in...) + in = append(in, Base64ToBytes(oracleUnknown)...) + return AESEncryptECB(in, oracleKey) +} + // Return a random number from range [min, max] func randomInt(min, max int64) int64 { if min >= max { |