1 Reply
      Latest reply on Dec 18, 2016 2:43 PM by eskimo
      oifc Level 1 Level 1 (0 points)

        I would like to do the similar encryption in the iOS


        KeyFactory keyFactory = KeyFactory.getInstance("RSA");

          RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(modulus, pubExp);

          RSAPublicKey key = (RSAPublicKey) keyFactory.generatePublic(pubKeySpec);

          Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");

          cipher.init(Cipher.ENCRYPT_MODE, key);

          byte[] cipherData = cipher.doFinal(value.getBytes());

          strEncryInfoData = new String(org.apache.commons.codec.binary.Base64.encodeBase64(cipherData));

        • Re: How to do RSA-2048 Encryption
          eskimo Apple Staff Apple Staff (13,925 points)

          You should look at the CryptoCompatibility sample code, which shows how to do various forms of encryption in a way that’s compatible with other common crypto toolkits.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"