Description
SwiftyRSA is a Swift library for RSA public and private key encryption. It lets an iOS or macOS app encrypt data with a public key and decrypt it with a private key, and it also signs data with a private key and verifies signatures with a public key. Keys can be created from a DER file, a PEM file, a PEM string, a Base64 string, raw data or a SecKey, and the library can create a new public and private key pair, export a key or read its content. It supports X.509 certificates for public keys, adding or stripping the X.509 header as needed. The library explains that it does this because the iOS keychain accepts keys only in a particular form, so storing or creating a key strips the header automatically. The README includes a quick start for encrypting and decrypting, plus advanced examples for each key format and operation. The project asks users to generate keys with ssh-keygen and to keep private keys in a secure place. Installation works with CocoaPods or Carthage and needs Swift 5.0 and Xcode 10.2 or later. The README also shows Objective-C usage. The README says the library is used in the Scoop iOS app to encrypt data before it is sent to an API. It is aimed at Swift developers who need RSA encryption in an app.…
Highlights
- Encrypt and decrypt with RSA public and private keys
- Sign data and verify signatures
- Keys from DER, PEM, Base64, data or SecKey
- X.509 header handling for keychain compatibility
- Installs with CocoaPods or Carthage
Ratings & Reviews
No ratings yet
Be the first to rate SwiftyRSA.
People also visit
SwiftyRSA FAQ
What is SwiftyRSA?
A Swift library for RSA public key encryption, decryption, signing and verification in iOS and macOS apps.
What does it require?
Swift 5.0 or later and Xcode 10.2 or later.
How do I install it?
With CocoaPods or Carthage. Objective-C usage is also shown in the README.
Which key formats can it read?
DER files, PEM files, PEM strings, Base64 strings, raw data and SecKey objects.
Why does it strip X.509 headers?
The README says the iOS keychain accepts keys only without the header, so the library strips it when a key is stored or created.
How do I create keys?
The README uses ssh-keygen to generate a PEM public key and a PEM private key, and advises keeping the private key in a secure place.
Who maintains it?
The README lists @ikeith as the maintainer. It says the library is used in the Scoop iOS app.
What are the best SwiftyRSA alternatives?
Popular alternatives to SwiftyRSA include SwiftyShield, Bouncy GPG and Ipaverse. See all SwiftyRSA alternatives





