How to decrypt minizip's WinZip AES using Apple's CryptoKit?

A project required me to decrypt minizip's WinZip AES on iOS. At the same time, Apple's CryptoKit is an upcoming framework to fulfil these kinds of needs by making use of specially designed hardware.

How to make use of Apple's CryptoKit to accomplish this requirement?

Thanks in advance.

Apple's CryptoKit is an upcoming framework to fulfil these kinds of
needs by making use of specially designed hardware.

To be clear, there’s no specific relationship to hardware in Apple CryptoKit [1]. It’ll use hardware acceleration where it’s available, but that’s true of other crypto APIs.

How to make use of Apple's CryptoKit to accomplish this requirement?

It depends on the specific flavour of AES used by this format. Apple CryptoKit tries to focus on good cryptography, so it only supports AES-GCM. If this format uses AES-GCM, you’re all set. If not, you’ll need some other API.

On Apple platforms that “other API” is usually Common Crypto. It supports various different modes, including AES-CBC. For more details, see the CCCryptorCreate man page.

If you have follow-up questions about the Apple-specific APIs, I encourage you to start a thread on Apple Developer Forums. Tag it with Apple CryptoKit or Security (for Common Crypto) so that I see it.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

[1] Well, except the SecureEnclave type.