forked from iamlay/Encryptions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRootViewController.m
More file actions
172 lines (127 loc) · 4.46 KB
/
RootViewController.m
File metadata and controls
172 lines (127 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
//
// RootViewController.m
// Encryption
//
// Created by 雷传营 on 16/1/10.
// Copyright © 2016年 leichuanying. All rights reserved.
//
#import "RootViewController.h"
#import "RSAViewController.h"
#import "DESViewController.h"
#import "JavaViewController.h"
#import "MD5Viewcontroller.h"
#import "AESViewController.h"
@interface RootViewController ()
@property(nonatomic, strong)UIButton *DESButton;//加密按钮
@property(nonatomic, strong)UIButton *RSAButton;//解密按钮
@property(nonatomic, strong)UIButton *JavaButton;//解密按//
@property(nonatomic, strong)UIButton *MD5Button;
@property(nonatomic, strong)UIButton *AESButton;
@end
@implementation RootViewController
-(void)viewDidLoad
{
self.view.backgroundColor = [UIColor redColor];
self.navigationItem.title= @"各种类型加密";
[self.DESButton setTitle:@"DES加密" forState:UIControlStateNormal];
[self.RSAButton setTitle:@"RSA加密" forState:UIControlStateNormal];
[self.JavaButton setTitle:@"RSA &Java server" forState:UIControlStateNormal];
[self.MD5Button setTitle:@"MD5加密" forState:UIControlStateNormal];
[self.AESButton setTitle:@"AES加密" forState:UIControlStateNormal];
[self setNavBackArrow];
}
//DES加密数据btn
-(UIButton *)DESButton
{
if (!_DESButton)
{
_DESButton = [UIButton buttonWithType:UIButtonTypeCustom];
_DESButton .frame = CGRectMake((kMainScreenWidth-100)/2-150, 100, 100, 30);
_DESButton .backgroundColor = [UIColor blueColor];
[_DESButton addTarget:self action:@selector(DESdetailVC) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_DESButton];
}
return _DESButton;
}
//RSA加密数据btn
-(UIButton *)RSAButton
{
if (!_RSAButton)
{
_RSAButton = [UIButton buttonWithType:UIButtonTypeCustom];
_RSAButton.frame = CGRectMake((kMainScreenWidth-100)/2-150, 150, 100, 30);
_RSAButton.backgroundColor = [UIColor blueColor];
[_RSAButton addTarget:self action:@selector(RSAdetailVC) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_RSAButton];
}
return _RSAButton;
}
//RSA加密数据btn
-(UIButton *)JavaButton
{
if (!_JavaButton)
{
_JavaButton = [UIButton buttonWithType:UIButtonTypeCustom];
_JavaButton.frame = CGRectMake((kMainScreenWidth-100)/2-150, 200, 150, 30);
_JavaButton.backgroundColor = [UIColor blueColor];
[_JavaButton addTarget:self action:@selector(JAVAdetailVC) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_JavaButton];
}
return _JavaButton;
}
//MD5加密数据btn
-(UIButton *)MD5Button
{
if (!_MD5Button)
{
_MD5Button = [UIButton buttonWithType:UIButtonTypeCustom];
_MD5Button.frame = CGRectMake((kMainScreenWidth-100)/2-150, 250, 150, 30);
_MD5Button.backgroundColor = [UIColor blueColor];
[_MD5Button addTarget:self action:@selector(MD5detailVC) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_MD5Button];;
}
return _MD5Button;
}
-(UIButton *)AESButton
{
if (!_AESButton)
{
_AESButton = [UIButton buttonWithType:UIButtonTypeCustom];
_AESButton.frame = CGRectMake((kMainScreenWidth-100)/2-150, 300, 150, 30);
_AESButton.backgroundColor = [UIColor blueColor];
[_AESButton addTarget:self action:@selector(AESdetailVC) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_AESButton];;
}
return _AESButton;
}
//DES加密数据
-(void)DESdetailVC
{
DESViewController *DESVC= [[DESViewController alloc]init];
[self.navigationController pushViewController:DESVC animated:YES];
}
//RSA加密数据
-(void)RSAdetailVC
{
RSAViewController *RSAVC = [[RSAViewController alloc] init];
[self.navigationController pushViewController:RSAVC animated:YES];
}
//JAJA加密数据
-(void)JAVAdetailVC
{
JavaViewController *JAVAVC= [[JavaViewController alloc]init];
[self.navigationController pushViewController:JAVAVC animated:YES];
}
//MD5加密数据
-(void)MD5detailVC
{
MD5ViewController *md5VC= [[MD5ViewController alloc]init];
[self.navigationController pushViewController:md5VC animated:YES];
}
//AES加密数据
-(void)AESdetailVC
{
AESViewController *AESVC= [[AESViewController alloc]init];
[self.navigationController pushViewController:AESVC animated:YES];
}
@end