forked from public/pysim
Compare commits
5 Commits
914abe3309
...
pmaier/ota
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2548becddf | ||
|
|
af21005c94 | ||
|
|
ea3b9937e5 | ||
|
|
da8c813034 | ||
|
|
2d5e20e342 |
@@ -266,13 +266,11 @@ class SCP02(SCP):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
def dek_encrypt(self, plaintext:bytes) -> bytes:
|
def dek_encrypt(self, plaintext:bytes) -> bytes:
|
||||||
# See also GPC section B.1.1.2, E.4.7, and E.4.1
|
cipher = DES.new(self.card_keys.dek[:8], DES.MODE_ECB)
|
||||||
cipher = DES3.new(self.sk.data_enc, DES.MODE_ECB)
|
|
||||||
return cipher.encrypt(plaintext)
|
return cipher.encrypt(plaintext)
|
||||||
|
|
||||||
def dek_decrypt(self, ciphertext:bytes) -> bytes:
|
def dek_decrypt(self, ciphertext:bytes) -> bytes:
|
||||||
# See also GPC section B.1.1.2, E.4.7, and E.4.1
|
cipher = DES.new(self.card_keys.dek[:8], DES.MODE_ECB)
|
||||||
cipher = DES3.new(self.sk.data_enc, DES.MODE_ECB)
|
|
||||||
return cipher.decrypt(ciphertext)
|
return cipher.decrypt(ciphertext)
|
||||||
|
|
||||||
def _compute_cryptograms(self, card_challenge: bytes, host_challenge: bytes):
|
def _compute_cryptograms(self, card_challenge: bytes, host_challenge: bytes):
|
||||||
|
|||||||
Reference in New Issue
Block a user