ifish/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/md5/MD5Manager.h

55 lines
1.8 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// MD5Manager.h
// 2cu
//
// Created by wutong on 15/12/16.
// Copyright © 2015年 guojunyi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MD5Manager : NSObject
/*
函数功能: 密码转换
szPassword: 130位字符串
返回: 10位以下的unsigned int型数字
*/
+(unsigned int)GetTreatedPassword:(const char*) szPassword;
/*
函数功能:md5加密 兼容rtsp密码时会用到
szInputBuffer: 630位字符串 (如果输入字符串位数不在6~30之间或者输入10位以下的纯数字则不作任何处理直接返回NO)
szOutputBuffer: 32个字节的字符串用来保存md5密码后的数据
返回: YES成功加密结果保存在szOutputBuffer中NO加密失败
*/
+(BOOL)GetMD5PasswordWithSrc:(const char*)szInputBuffer Dst:(char*)szOutputBuffer;
/*
函数功能:服务器保存的设备密码的解密函数(应用场景:从服务器获取设备列表)
szSrcData:密文
szUserID:登陆账号关联的ID
szOutputBuffer:用于保存明文的缓存,由用户提供
iLength:用于保存明文的缓存的长度
返回值:0-成功 1-因输出缓存太小而执行失败
*/
+(unsigned int)PassswrodDecrypt:(char*)szSrcData UserID:(char*)szUserID Dst:(char*)szOutputBuffer Len:(unsigned int)iLength;
/*
函数功能:服务器保存的设备密码的加密函数(应用场景:上传设备列表到服务器)
szSrcData:明文
szUserID:登陆账号关联的ID
szOutputBuffer:用于保存密文的缓存,由用户提供
iLength:用于保存密文的缓存的长度
返回值:0-成功 1-因输出缓存太小而执行失败
*/
+(unsigned int)PasswordEncrypt:(char*)szSrcData UserID:(char*)szUserID Dst:(char*)szOutputBuffer Len:(unsigned int)iLength;
/*
函数功能:base64解密
*/
+(char *)lib_base64_decode:(const char* )data len:(int)data_len;
@end