1.代码 iOS常用加密方法(aes.md5.base64) .AES加密 NSData+AES.h文件 // // NSData-AES.h // Smile // // Created by 周 敏 on 12-11-24. // Copyright (c) 2012年 BOX. All rights reserved. // #import <Foundation/Foundation.h> @class NSString; @interface NSData (Encryption)…
  iOS常用公共方法 字数2917 阅读3070 评论45 喜欢236 1. 获取磁盘总空间大小 //磁盘总空间 + (CGFloat)diskOfAllSizeMBytes{ CGFloat size = 0.0; NSError *error; NSDictionary *dic = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error]; if (error…
iOS常用公共方法 1. 获取磁盘总空间大小 //磁盘总空间 + (CGFloat)diskOfAllSizeMBytes{ CGFloat size = 0.0; NSError *error; NSDictionary *dic = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error]; if (error) { #ifdef DEBUG NSLog(@&quo…
本文转载至 http://blog.csdn.net/wildfireli/article/details/23191983 (AES.MD5.Base64) 分类: iPhone 2014-04-08 16:30 187人阅读 评论(0) 收藏 举报 目录(?)[+] 1.AES加密 NSData+AES.h文件 // // NSData-AES.h // Smile // // Created by Gary on 12-11-24. // Copyright (c) 2012年 BOX.…
前言: iOS常用的加密有很多种,前两天在工作中遇到了RSA加密,现在把代吗分享出来. RSA基本原理 RSA使用"秘匙对"对数据进行加密解密.在加密解密数据前,需要先生成公钥(public key)和私钥(private key). 公钥(public key): 用于加密数据. 用于公开, 一般存放在数据提供方, 例如iOS客户端. 私钥(private key): 用于解密数据. 必须保密, 私钥泄露会造成安全问题 第一步:公钥.私钥的生成 iOS开发者可直接在Mac终端生成,命…
using System; using System.IO; using System.Security.Cryptography; using System.Text; /// <summary> /// Encrypt 的摘要说明 /// </summary> public static class Encrypt {     #region 解密由AES加密的字符串     /// <summary>     /// 解密由AES加密的字符串     /// &l…
这些都是项目中常用但又常忘的方法,与大家分享一下. 一.NSString 创建字符串.  NSString *astring = @"This is a String!"; 创建空字符串,给予赋值.  NSString *astring = [[NSString alloc] init]; astring = @"This is a String!"; NSLog(@"astring:%@",astring); 使用变量初始化  NSString…
C#版: using System; using System.Security.Cryptography; using System.Text; namespace ConsoleApplication1 { class EncryptHelper { /// <summary> /// MD5加密 /// </summary> /// <param name="plaintext">明文</param> /// <param n…
GTMDefines.h // // GTMDefines.h // // Copyright 2008 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at…
NSString+Encryption.h // // NSString+Encryption.h // haochang // // Created by Administrator on 14-4-15. // Copyright (c) 2014年 Administrator. All rights reserved. // #import <Foundation/Foundation.h> @interface NSString (Encryption) + (NSString *)m…