Giter Site home page Giter Site logo

Add Decrypt function about objective-c-rsa HOT 9 OPEN

ideawu avatar ideawu commented on July 22, 2024
Add Decrypt function

from objective-c-rsa.

Comments (9)

btnguyen2k avatar btnguyen2k commented on July 22, 2024

Swift implementation, also has decryption function: https://github.com/btnguyen2k/swift-rsautils

from objective-c-rsa.

ideawu avatar ideawu commented on July 22, 2024

@btnguyen2k Can you add Objective-C version descryption function to this project?

from objective-c-rsa.

btnguyen2k avatar btnguyen2k commented on July 22, 2024

@ideawu I have created a pull request for decryption function.

from objective-c-rsa.

coskungun avatar coskungun commented on July 22, 2024

how to decryption private key ?

from objective-c-rsa.

btnguyen2k avatar btnguyen2k commented on July 22, 2024

@coskungun, private key is a bit more complicated than I thought.
I have add function to decrypt with private key in my Swift version: https://github.com/btnguyen2k/swift-rsautils

Still, encryption with private key has not worked yet.
I will be investigating this a few more days and will update the ObjC code latter.

from objective-c-rsa.

ideawu avatar ideawu commented on July 22, 2024

Thanks to @btnguyen2k , we have more functions now:

+ (NSString *)decryptString:(NSString *)str publicKey:(NSString *)pubKey;
+ (NSData *)decryptData:(NSData *)data publicKey:(NSString *)pubKey;
+ (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey;
+ (NSData *)decryptData:(NSData *)data privateKey:(NSString *)privKey;

from objective-c-rsa.

coskungun avatar coskungun commented on July 22, 2024

@btnguyen2k thank you very much. =)

from objective-c-rsa.

thidayatullah avatar thidayatullah commented on July 22, 2024

@ideawu : I want to do testing but when I try to decrypt using private_key it return nil.

specifically on the method :
+ (NSData *)stripPrivateKeyHeader:(NSData *)d_key
the data is there (610 bytes long) but it returns nil after being stripped.

from objective-c-rsa.

stdawn avatar stdawn commented on July 22, 2024

ios9 真机调试下,RSA加密会随机失败,怎么解决,static public func encryptWithRSAPublicKey(data: NSData, pubkeyBase64: String, keychainTag: String) -> NSData? 方法随机返回 nil

from objective-c-rsa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.