microsoft / go-crypto-winnative

Go crypto backend for Windows using CNG
MIT License
28 stars 3 forks source link

Add support for DES #42

Closed qmuntal closed 1 year ago

qmuntal commented 1 year ago

This will be used in crypto/des.

I've refactored the AES implementation so it can share code with DES, as they are both implemented using similar CNG APIs.

This PR also implements DES over CBC mode so it can be used as a cipher.BlockMode in cipher.NewCBCDecrypter and cipher.NewCFBEncrypter.

Note that DES doesn't support GCM mode, and CNG doesn't implement the CTR mode (neither it does for AES https://github.com/microsoft/go-crypto-winnative/issues/4).

qmuntal commented 1 year ago

@dagood I've pushed one more commit implementing DES over CBC mode, please review that too.