-
Notifications
You must be signed in to change notification settings - Fork 34
Base64 encode issue #3
Comments
Have you test with the php script? Just copy the output from console, then test it with php script. See if it works |
Can confirm there is an issue with the base64 encode, a test of 100,000 attempts to encrypting a string using a public key gave a maximum of 2714 attempts before the output was not (null). Changing the code to return the unsigned char * and its length, creating an NSData object from that and returning a base64 encoded string was our solution. |
@amccague Thanks for confirming. Could you post the relevant code changes please? |
@amccague You may submit a pull request here. Thanks |
Can any one help me on the same issue. Public Encrypt is retuning nil. If any one has the fixed code snippet please share me. Thanks, |
Merged a pull request #12 |
Hi, back with another issue, base64 encoding sometimes gives invalid output, for example:
FsYAyq8KfCz5B41dRDqxuZR8xhvFuAKZE7nWDn3MrnCRYio8wj0PYeNDD1u4G/Bj36fjPWMUzx+CZfSjZhOaHMBC7cnbw0D5JrN2RDLFHQC5C7Mkw7I1Oq2mf5byDl+ayHHAGHqv8Ztj4zBuBJX4v1ZF48BGW+mNiiQWtiFBVODbL6Qu56Do1iyaoRaStRKwtd9mppdmmZJWa8YTtt7+9Q1yB07IRan+Qg5kUku8AmRLp9nNZ3k1/60pv+V7nPp7CkYWIZ3ASNQOVMRbsjoiEfmPlipuZtLLVqJTLY8xGaFuKSvQ5Ibdj0GUkycWbZYbe8T4KaFyk55qlapyUsFArw==ar=grego
The characters after == shouldn't be there, but there is data stored in them since it also doesn't work if I remove them.
Any fixes/workarounds available? My C skills are terrible so I'm at a loss here. Different encoding (hex for example) would also be ok.
Other example:
Pi/+a+8kPNZRZk4Mm+vjniOmUMzE67/69P7/vP/pySJ4QFWWpVSSSEQuX+LB+vCF85neGbJ2fp4DYuZFI0eZyo382zCThxEAjmATUAXmAz4ZgopQkQVv9MHPTVzbRecDcY1t+AeiyhhHhXzNl4U2e0xYrEgnZcrZXE8/YfmoPgr2yeBNfIRQE2BFLXNZRGZUZkdzbjrhmouBclgv7mN37SPZr0gj8VSSbKzOM5ElGKuw4joc9iIJhG5x99Z617STNkbXg5KgHbFLs9/rrafd6obHkiLltmFqsaw/MNgkpm7YrIKaa2XxlUkiNE5EOp37A7snsKlJpa3HBGDPom+D1Q==µ∫Âfl›öQ'
The text was updated successfully, but these errors were encountered: