# RSA
### Simplest RSA Wrapper
---
Internet has very little to offer for RSA on iOS. Over complicated code, no documentation or using 3rd Part Frameworks when it can be done using native `Security` framework on iOS
![Screen Shot](screenshot.png)
Note: Most methods return Base64 encoded strings.
### 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)generateKeyPairRSACompleteBlock:(GenerateSuccessBlock)_success;
```
##### 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 Public Key
```
// Use setPublicKey before using this method to set the server public key
- (NSString *)encryptUsingServerPublicKeyWithData:(NSData *)data;
```
---
### Have a Java Backened ?
##### It needs small modification for working with iOS
Great many thanks to Berin for [his blog post](http://blog.wingsofhermes.org/?p=75) on getting this working.
##### SET / GET Public key for Java Servers
```
- (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.
没有合适的资源?快使用搜索试试~ 我知道了~
RSA.zip_encryption_不对称加密
共90个文件
sample:9个
m:5个
head:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 32 浏览量
2022-09-14
22:43:38
上传
评论
收藏 266KB ZIP 举报
温馨提示
rsa 对称加密,不对称加密 。iOS 开发,直接加载就可以了 l。已经测试通过
资源详情
资源评论
资源推荐
收起资源包目录
RSA.zip (90个子文件)
RSA
RSA.xcodeproj
project.xcworkspace
contents.xcworkspacedata 148B
xcuserdata
reejosamuel.xcuserdatad
UserInterfaceState.xcuserstate 17KB
letv.xcuserdatad
UserInterfaceState.xcuserstate 14KB
xcshareddata
RSA.xccheckout 1KB
project.pbxproj 20KB
xcuserdata
reejosamuel.xcuserdatad
xcschemes
RSA.xcscheme 3KB
xcschememanagement.plist 565B
xcdebugger
Breakpoints_v2.xcbkptlist 91B
letv.xcuserdatad
xcschemes
RSA.xcscheme 4KB
xcschememanagement.plist 565B
xcdebugger
Breakpoints_v2.xcbkptlist 768B
readme.md 3KB
.git
index 2KB
hooks
pre-push.sample 1KB
prepare-commit-msg.sample 1KB
applypatch-msg.sample 452B
pre-commit.sample 2KB
pre-applypatch.sample 398B
commit-msg.sample 896B
pre-rebase.sample 5KB
update.sample 4KB
post-update.sample 189B
config 308B
description 73B
refs
tags
heads
master 41B
remotes
origin
HEAD 32B
branches
logs
refs
heads
master 179B
remotes
origin
HEAD 179B
HEAD 179B
packed-refs 107B
objects
43
e71a8c5da876c32591af414b3bbb1f6ec397f1 1KB
d5
46f281fc5ae012eb19eaef7634c349d0cca8f2 4KB
6c540732553fe82630d1c8598f8923aae0b7bf 931B
6c
fc746d4ecf2e3ac67bb0cf6c4013e1aff9b1f1 58B
87
48d46e9069d446cce54773c3ed06b9f2d443a0 899B
8a
38ac047145abe5148834168bb422b2b4298f66 505B
a3
96706db4ec4cfca4d984d38b90dc8098bded40 147B
ef
9a6691591ca1ef19759f179848aeb983614d2e 78KB
35
750a262a0cba77b8a24cb6a5a955ccc4ac20fc 70B
1a
729ae7de1d3d3c2f23cff393025ce4a04cb609 331B
ca
c14beb59f456c5540ad5e2695547dc33cb6dd7 404B
de
0716863ea87b6ab72a53cec1f8cbf6cbbc617b 129B
db
14e5d45284674cd643388691624a3ac6e62e91 84B
82
a2bb45076d290ce7461b28d5a579e649777779 247B
5b
380d7665b36f1fe9410bfdeff4527106af7fb4 71B
8bd5172c1314e5476adc857f9b23289ce08cfa 351B
c7
9ebd3ada1309bae694b8e6760592b1254e035c 187B
97
ad08424a906808d7f35b367021396a55d8c95d 686B
34
a2e3f07f1267e1aa110af818a5913cc7226c94 102B
info
47
7b28ff8f86a3158a71c4934fbd3a2456717d7a 61B
f3
a27cbadbf41c5c1493f9802447ac10c09ad417 131B
pack
1c
0e17c2654409e1c478483f71bb903fe30ce5f6 64B
cb
f892b0509ed5d32daa7f37f2551d7b152e73bd 129B
fe
2b45415124ec4c223006e19defd56850da95d9 91B
25
60a2b9ab9323ca61a0fdebd3b4af46dbe4c272 100B
130d4179faa045b837a088ed18472b11f8b06c 214B
7c
99b09aab89d45fb9f75858dfda824d423abdaa 98B
cf
583b5552a2f78081b5339915d25b541bd659d9 356B
928e372474c66173f2e4978e1757818b632284 64B
3a
c2457b7071413a28b0ce55830887c35625911e 253B
f86eaff6781652fbe2fc833cb806071ddae910 60B
b9
9b1f5f21626e73af257cd78cdc886bc5f45912 11KB
02
37597b848a1890bb30ba0ff4102f8107cafdcb 61B
4a
479b0912b8abd64b4232b9646355d23dbd3cdc 313B
3c
0fbbc657e091e02b678ad79db707f0f8583c1c 125B
e3
7fc00e614d700cd1cfa2cbfa43ae5eae93244c 185B
b6
149470f1683d5c9f81cabec4b1385f41952405 855B
6f
3b0ab36651ca648408c176f81e4b2e202efa0b 58B
f1
b75e10e8a7d1a823eb6ef13ac8542340b46c8c 3KB
b4
5f1f53f6dd571b0c72106b803efb49aedb11c2 5KB
info
exclude 240B
HEAD 23B
.DS_Store 6KB
screenshot.png 86KB
RSATests
RSATests.m 619B
RSATests-Info.plist 695B
en.lproj
InfoPlist.strings 45B
RSA
main.m 332B
RSA-Prefix.pch 344B
RSA.m 19KB
AppDelegate.h 272B
AppDelegate.m 2KB
RSA-Info.plist 1KB
Base.lproj
Main.storyboard 15KB
ViewController.h 766B
Images.xcassets
AppIcon.appiconset
Contents.json 333B
LaunchImage.launchimage
Contents.json 442B
ViewController.m 2KB
en.lproj
InfoPlist.strings 45B
RSA.h 2KB
共 90 条
- 1
局外狗
- 粉丝: 64
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0