Encrypt/Decrypt APIs from Ncrypt.h header take long time to execute

Sudheendra Subbarao 6 Reputation points
2022-06-28T09:51:06.517+00:00

We are trying to use Encrypt/Decrypt APIs from Ncrypt.h header.

To Encrypt, we use the below list of APIs

NCryptOpenStorageProvider
NCryptCreatePersistedKey
NCryptFinalizeKey
NCryptEncrypt
NCryptDecrypt

We see that 2 of the APIs namely NCryptFinalizeKey and NCryptDecrypt take a long time to execute nearly 1-2 seconds compared to other APIs which hardly take few milliseconds to execute.

Would like to know if this is the expected behaviour or we are missing anything here.
Any insight on this would be of real help

Universal Windows Platform (UWP)
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,540 questions
{count} votes