【问题标题】:Where is the class CryptoCommon in xamarinxamarin 中的 CryptoCommon 类在哪里
【发布时间】:2014-02-21 10:38:11
【问题描述】:

我正在尝试使用 CryptoCommon 类,但无法在 monotuch 程序集中找到它。

我找到了 Mono.Security.Cryptography 程序集,它的性能是否与 CryptoCommon 类相同?

谢谢!!

【问题讨论】:

    标签: ios xamarin.ios cryptography xamarin commoncrypto


    【解决方案1】:

    CommonCrypto 在 Xamarin.iOS 内部使用,这不是额外的 - 即无需选择加入或退出。

    这意味着它的使用对您的代码完全透明。如果 CommonCrypto 中提供算法,则使用 classic .NET 类型将使用它。

    例如

    // this will use CommonCrypto. AES is supported by CommonCrypto
    // if your device supports it AES can be hardware accelerated
    var aes = Aes.Create (); 
    
    // this will also use CommonCrypto. SHA-1 is supported by CommonCrypto
    // if your device supports it SHA-1 can be hardware accelerated
    var sha = new SHA1Managed (); 
    
    // this will not use CommonCrypto since the algorithm is not supported by Apple
    var r = RIPEMD160.Create (); 
    

    更多关于 CommonCrypto 的 information 可以在我的博客上找到。

    【讨论】:

    • 非常感谢,我实际上已经在看你的博客了。我必须对图像进行加密以满足 HIPAA 规定,您认为哪种密码算法在这种情况下最好?
    • 从未阅读过 HIPAA 规定,所以我知道他们的要求。今天大多数人使用 AES 加密数据(128 到 256 位),但最重要的是通常是密钥管理(而不是加密本身)。
    猜你喜欢
    • 2017-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多