Latest 1.0.4
Homepage https://github.com/kingly09/KYSM4
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

KYSM4是一个基于SM4国密算法的Objective-C的国密SM4加密类

前几天项目用到sm4加密解密,加密为十六进制字符串,再将十六进制字符串解密。sm4是密钥长度和加密明文加密密文都为16个字节十六进制数据,网上的sm4 c语言算法很容易搜到,笔者刚开始没怎么理解,以为只能对16字节数据进行加密,并且不论是多少字节的数据加密出来都是16字节的。后来看了下源码,应该是加密的数据应该是16字节或者16的整数倍个字节的数据,若不够16倍数字节应该补0x00数据,最后加密出来的数据和输入数据的长度应该一致。

Latest podspec

{
    "name": "KYSM4",
    "version": "1.0.4",
    "summary": "KYSM4u662fu4e00u4e2au57fau4e8eSM4u56fdu5bc6u7b97u6cd5u7684Objective-Cu7684u56fdu5bc6SM4u7b97u6cd5u7c7bu5e93u3002",
    "homepage": "https://github.com/kingly09/KYSM4",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "kingly": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/kingly09/KYSM4.git",
        "tag": "1.0.4"
    },
    "social_media_url": "https://github.com/kingly09",
    "source_files": "KYSM4/**/*",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This