0
Follow
0
View

Has RSA encryption been deprecated in iOS16?

fcbzyy 注册会员
2023-02-26 14:12

Part of this answer references GPT, GPT_Pro to better solve the problem
Since ios 16 has deprecated RSA encryption, So iphones and computers may no longer support RSA encryption. This means that the SecKeyEncrypt method cannot be used for RSA encryption in recent versions of ios.

However, this does not mean that RSA encryption is completely invalid, but that users need to adopt other methods to implement RSA encryption. For example, you can use OpenSSL, an open source encryption library, to implement RSA encryption. OpenSSL is also widely used on Apple, so it can be used on iOS.

Here is an example code to implement RSA encryption using OpenSSL:

#include 
#include 

/* 产生 1024 位的 RSA key */
RSA *generateRSAKey(unsigned int bits){
    RSA *rsa = NULL;
    BIGNUM *bne = NULL;
    bne = BN_new();
    int ret = BN_set_word(bne, RSA_F4);

    if(ret != 1){
        return NULL;
    }

    rsa = RSA_new();

    ret = RSA_generate_key_ex(rsa, bits, bne, NULL);

    if(ret != 1){
        return NULL;
    }
    
    return rsa;
}

The code above helps us implement RSA encryption with OpenSSL in ios 16. In addition, we can also choose other encryption libraries to implement RSA encryption, such as Crypto++, Botan, Libgcrypt, Libsodium and so on. So, even though RSA encryption is deprecated in ios 16, there are other ways to implement RSA encryption.
If the answer is helpful, please accept it.

About the Author

Question Info

Publish Time
2023-02-26 14:12
Update Time
2023-02-26 14:12