Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
326 views
in Technique[技术] by (71.8m points)

c# - How to determine the Encryption Algorithm for Azure.Security.KeyVault.Keys.Cryptography.CryptographyClient.Decrypt on Keys

The CryptographyClient requires EncryptionAlgorithm for the Decrypt operation. How can I determine what to use for a Self-Signed Key I created in OpenSSL or whatever for whatever key?

The EncryptionAlgorithm offers enum values of

  1. Rsa15
  2. RsaOaep
  3. RsaOaep256

How do I choose out of the above if I already created Self-Signed RSA Key using OpenSSL?

question from:https://stackoverflow.com/questions/65841089/how-to-determine-the-encryption-algorithm-for-azure-security-keyvault-keys-crypt

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Those algorithms are encryption algorithms, not key types. Which you should use depends on your application. Rsa15 (algorithm "RSA1_5") is old and not recommended for secure applications. RsaOaep (algorithm "RSA-OAEP") is probably more prolific but uses SHA-1 to hash, so RsaOaep256 (algorithm (RSA-OAEP-256) is more secure since it uses SHA-256.

You can read about these algorithms from various sources including Wikipedia.

In the Key Vault SDK for C#, we also support those algorithms locally if you have the key material (like public key for encryption) locally, since those same algorithms are supported locally. Some algorithms may not always be supported, like EC keys on .NET Framework 4.6.1 which will throw a NotSupportedException.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...