CryptoExportImportManager | swift class for exporting and importing public keys | SSH Utils library

 by   DigitalLeaves Swift Version: Current License: No License

kandi X-RAY | CryptoExportImportManager Summary

kandi X-RAY | CryptoExportImportManager Summary

CryptoExportImportManager is a Swift library typically used in Utilities, SSH Utils applications. CryptoExportImportManager has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

This class tries to make it easier for a developer to import public keys from an external source (i.e: a backend or server, generated by OpenSSL) or exporting the generated public keys to a format readable to external sources (i.e: openSSL or PHP (i.e: openssl_get_publickey).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              CryptoExportImportManager has a low active ecosystem.
              It has 142 star(s) with 32 fork(s). There are 10 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 5 open issues and 8 have been closed. On average issues are closed in 87 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of CryptoExportImportManager is current.

            kandi-Quality Quality

              CryptoExportImportManager has 0 bugs and 0 code smells.

            kandi-Security Security

              CryptoExportImportManager has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              CryptoExportImportManager code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              CryptoExportImportManager does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              CryptoExportImportManager releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of CryptoExportImportManager
            Get all kandi verified functions for this library.

            CryptoExportImportManager Key Features

            No Key Features are available at this moment for CryptoExportImportManager.

            CryptoExportImportManager Examples and Code Snippets

            No Code Snippets are available at this moment for CryptoExportImportManager.

            Community Discussions

            Trending Discussions on CryptoExportImportManager

            QUESTION

            Openssl verify fails with iOS Secure Enclave created signature
            Asked 2021-Feb-28 at 15:55

            I am attempting to hash and sign user data on iOS (14.4), send that to my server, and have the server verify the hash and the signature with a previously uploaded public key (sent on keypair generation during user creation). It seems a number of people have run into issues with this, but all of the answers I've been able to find are very old, don't factor in using Apple's Secure Enclave, or revolve around signing and verifying on the same iOS device.

            The general workflow is: User creates an account on iOS, and a random keypair is created on the device with the private key remaining in the Secure Enclave, while the public key is converted to ASN.1 format, PEM encoded and uploaded to the server. When the user later signs data, the data is JSONEncoded, hashed with sha512, and signed by their private key in the Secure Enclave. This is then packaged into a base64EncodedString payload, and sent to the server for verification. The server first verifies the hash using openssl_digest and then checks the signature using openssl_verify.

            I have been unable to get the openssl_verify method to successfully verify the signature. I have also attempted using the phpseclib library (to get more insight into why the verification fails) without success. I understand phpseclib uses the openssl library if it is available, but even if this is disabled, phpseclib's internal verification fails because the resulting values after modulus do not match. Interestingly, phpseclib converts the public key to what looks like PKCS8 formatting with a large amount of padding.

            It appears the public key is being parsed and loaded properly by openssl, as a proper reference is being created prior to verification. However, since the private key is opaque (residing in the Secure Enclave) I don't have a way to externally "check" how the signatures themselves are generated/encoded or if the same signature would be created outside of the iOS device. I'm wondering if I have an encoding error, or if external verification is possible with keys generated in the Secure Enclave.

            iOS Public Key Upload method- I am using CryptoExportImportManager which converts the raw bytes to DER, adds the ASN.1 header, and adds the BEGIN and END key tags.

            ...

            ANSWER

            Answered 2021-Feb-28 at 15:55

            I actually stumbled upon the solution while doing additional research and experimentation while writing this question. The problem of course had nothing to do with the keys or algorithms, and everything to do with the way Apple hashes data objects.

            I had discovered a similar problem when trying to determine why my hashes were not matching on the server-side vs the ones created on the iOS device. The user JSONEncoded data is hashed and signed as a base64Encoded data object, but unknown to me (and not in any documentation I could discover) iOS decodes the Data object and hashes the raw object, and re-encodes it (since this is opaque code it's possible this is not precisely accurate, but the result is the same). Therefore when checking the hash on the user data, I had to first base64decode the object, and then perform the hash. I had assumed that Apple would sign the encoded object as is (in order to not contaminate its integrity), but in fact, when Apple creates the digest before signing, it hashes the decoded raw object and creates a signature on the raw object.

            Therefore the solution was to again base64decode the object before sending it to the openssl_verify function.

            Checking the hash on the server

            Source https://stackoverflow.com/questions/66410953

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install CryptoExportImportManager

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/DigitalLeaves/CryptoExportImportManager.git

          • CLI

            gh repo clone DigitalLeaves/CryptoExportImportManager

          • sshUrl

            git@github.com:DigitalLeaves/CryptoExportImportManager.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular SSH Utils Libraries

            openssl

            by openssl

            solid

            by solid

            Bastillion

            by bastillion-io

            sekey

            by sekey

            sshj

            by hierynomus

            Try Top Libraries by DigitalLeaves

            DLHamburguerMenu

            by DigitalLeavesSwift

            CommonCrypto-in-Swift

            by DigitalLeavesSwift

            YourPersonalWishlist

            by DigitalLeavesSwift

            AsymmetricCrypto

            by DigitalLeavesSwift

            PlaceholderTextViewDemo

            by DigitalLeavesSwift