Giter Club home page Giter Club logo

asymmetriccrypto's People

Contributors

digitalleaves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

asymmetriccrypto's Issues

Unsafe warnings with Swift 5

Hello,

I just upgraded a project where we use AsymmetricCrypto to Swift 5 and we are now getting several warnings "withUnsafeMutableBytes is deprecated...", e.g.::

image

It would be great if you could handle this.

Thanks.

Can getPublicKeyData be made public again?

Hello,

I just upgraded to Swift 3 and also upgraded AssymetricCrypto. However, I am using getPublicKeyData which is now fileprivate so my code will not build. I can easily fix this by simply removing fileprivate, but I wanted to know if there is another way to get the public key data that I should be using. What I am currently doing:

AsymmetricCryptoManager.sharedInstance.createSecureKeyPair({ (success, error) in
   if success {
      let cryptoImportExportManager = CryptoExportImportManager()
      let publicKeyData = AsymmetricCryptoManager.sharedInstance.getPublicKeyData()
      publicKeyPem = cryptoImportExportManager.exportRSAPublicKeyToPEM(publicKeyData!, keyType: kSecAttrKeyTypeRSA as String, keySize: 2048)
                    
   } else {
      Log.error?.message("Error creating key pair: \(error.debugDescription)")
}

Perhaps you can remove fileprivate, unless there is a better way to do the above?

Thanks.

Consider adding the LICENSE file

Hey Ignacio, I just stumbled upon your repo and find this to be a good wrapper for the Security framework. I noticed in your blog post that the license adopted for this code is the MIT license. Do you mind adding this to the repo for clarity? Cheers.

There's no way to use my own keys?

I wish to use my public key to decrypt a string but I can't find any way to do so.
The asymetric crypto uses a generator for the keys.

Is there any way to make it work with my keys?

Can i decrypt my Encrypted message from my Go using EncryptPKCS1v15

Currently, i'm trying to implement this library to generate public key in my iOS device, and save it in my database through API.

When i send this public key from this library, i modify publicKeyData using https://github.com/DigitalLeaves/CryptoExportImportManager

But, when i encrypt from my backend (GoLang), and i tried to decode the encrypted message from my backend with this code:

   let encryptedData = Data(base64Encoded: encryptedMessage, options: [])
    
    AsymmetricCryptoManager.sharedInstance.decryptMessageWithPrivateKey(encryptedData!) { (success, result, error) -> Void in
        if success {
            print("result: \(result)")
        } else {
            print("Error decoding base64 string: \(error)")
        }
    }

it got error decoding base64 string: Optional(com.myProjects.AsymmetricCryptoException.unableToDecrypt)

After several research, i found, Golang encrypt using EncryptPKCS1v15 (https://github.com/golang/go/blob/master/src/crypto/rsa/pkcs1v15.go)
which make the iOS app failed to decrypt it because it only has PKCS1.

What should i do to decrypt with PKCS1v15 padding ?

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.