All Projects → reejosamuel → Rsa

reejosamuel / Rsa

Simple RSA wrapper for iOS

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Rsa

Ctf Rsa Tool
a little tool help CTFer solve RSA problem
Stars: ✭ 350 (+343.04%)
Mutual labels:  rsa
Swcrypt
RSA public/private key generation, RSA, AES encryption/decryption, RSA sign/verify in Swift with CommonCrypto in iOS and OS X
Stars: ✭ 632 (+700%)
Mutual labels:  rsa
Mirage Crypto
Cryptographic primitives for MirageOS
Stars: ✭ 39 (-50.63%)
Mutual labels:  rsa
Nupdate
A comfortable update solution for .NET-applications.
Stars: ✭ 394 (+398.73%)
Mutual labels:  rsa
F License
Open Source License Key Generation and Verification Tool written in Go
Stars: ✭ 535 (+577.22%)
Mutual labels:  rsa
Openssl Nodejs
is a package which gives you a possibility to run every OpenSSL command 🔒 in Node.js in a handy way. Moreover, parameters like -in, -keyin, -config and etc can be replaced by a raw data (Buffor).
Stars: ✭ 25 (-68.35%)
Mutual labels:  rsa
Python Rsa
Python-RSA is a pure-Python RSA implementation.
Stars: ✭ 308 (+289.87%)
Mutual labels:  rsa
Android Rsa
big file and string RSA encryption by android
Stars: ✭ 66 (-16.46%)
Mutual labels:  rsa
Learningmasteringalgorithms C
Mastering Algorithms with C 《算法精解:C语言描述》源码及Xcode工程、Linux工程
Stars: ✭ 615 (+678.48%)
Mutual labels:  rsa
Silver Sniffle
Ncurses TCP Chat
Stars: ✭ 38 (-51.9%)
Mutual labels:  rsa
Roca
ROCA: Infineon RSA key vulnerability
Stars: ✭ 452 (+472.15%)
Mutual labels:  rsa
Rsa And Lll Attacks
attacking RSA via lattice reductions (LLL)
Stars: ✭ 482 (+510.13%)
Mutual labels:  rsa
Rsa Javascript
rsa-javascript
Stars: ✭ 13 (-83.54%)
Mutual labels:  rsa
Heimdall
Heimdall is a wrapper around the Security framework for simple encryption/decryption operations.
Stars: ✭ 369 (+367.09%)
Mutual labels:  rsa
Node Rsa
Node.js RSA library
Stars: ✭ 1,120 (+1317.72%)
Mutual labels:  rsa
Netcore.encrypt
NETCore encrypt and decrpty tool,Include aes,des,rsa,md5,sha1,sha256,sha384,sha512
Stars: ✭ 339 (+329.11%)
Mutual labels:  rsa
Swiftyrsa
RSA public/private key encryption in Swift
Stars: ✭ 894 (+1031.65%)
Mutual labels:  rsa
Encryptlab
A Free and Comprehensive Encrypt and Decrypt Tools Website with example code in Node.js, Website is looking for a new server.
Stars: ✭ 69 (-12.66%)
Mutual labels:  rsa
Low Latency Android Ios Linux Windows Tvos Macos Interactive Audio Platform
🇸Superpowered Audio, Networking and Cryptographics SDKs. High performance and cross platform on Android, iOS, macOS, tvOS, Linux, Windows and modern web browsers.
Stars: ✭ 1,121 (+1318.99%)
Mutual labels:  rsa
Dbtransitencryption
Secure data before sending it over the internet
Stars: ✭ 20 (-74.68%)
Mutual labels:  rsa

RSA in iOS

RSA wrapper in ObjectiveC and Quick sample project to test


Internet had very little to offer for RSA on iOS (at the time of first commit). Over complicated code, no documentation or required using 3rd Party Frameworks.

This can be done natively on iOS using the Security framework. So to save future readers some time, this project was put together.

RSA.h

// Start a instance using +(void)sharedInstance

// Then call this method with 3 unique string as indentifiers
// Identifier in simple words is just names to used to remember these keys in a keychain

- (void)setIdentifierForPublicKey:(NSString *)pubIdentifier
                       privateKey:(NSString *)privIdentifier
                  serverPublicKey:(NSString *)servPublicIdentifier;
// Call this to generate the a pair of public and private keys for the mobile
- (void)generateRSAKeyPair:(RSACompletionBlock)completion;
Helper Methods
// Set the key size of RSA.
// enum RSAKeySize
//    k512 = 512
//    k768 = 768
//    k1024 = 1024
//    k2048 = 2048

- (void)setRSAKeySize:(RSAKeySize)keySize;


// Use this to remove the PEM encoding
- (NSString *)stripPEM:(NSString *)keyString;

Encryption Methods
- (NSString *)encryptUsingPublicKeyWithData:(NSData *)data;
- (NSString *)encryptUsingPrivateKeyWithData:(NSData*)data;
Decryption Methods
- (NSString *)decryptUsingPublicKeyWithData:(NSData *)data;
- (NSString *)decryptUsingPrivateKeyWithData:(NSData*)data;
SET and GET Public Key
- (BOOL)setPublicKey:(NSString *)keyAsBase64;
- (NSString *)getPublicKeyAsBase64;
Encrypt using Server's Public Key
// Use setPublicKey before using this method to set the server public key
- (NSString *)encryptUsingServerPublicKeyWithData:(NSData *)data;

Have a Java Backened ?

It might require OID padding in the keys encoding to get it interfacing with iOS.

Great many thanks to Berin for his blog post on getting this working.

Accessors for public key from java servers with OID in keys
- (BOOL)setPublicKeyFromJavaServer:(NSString *)keyAsBase64;
- (NSString *)getPublicKeyAsBase64ForJavaServer;

License

The MIT License (MIT)

Copyright (c) 2012 Reejo Samuel (http://reejosamuel.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].