Smart.Security 4.1.3

dotnet add package Smart.Security --version 4.1.3
                    
NuGet\Install-Package Smart.Security -Version 4.1.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Smart.Security" Version="4.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Smart.Security" Version="4.1.3" />
                    
Directory.Packages.props
<PackageReference Include="Smart.Security" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Smart.Security --version 4.1.3
                    
#r "nuget: Smart.Security, 4.1.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Smart.Security@4.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Smart.Security&version=4.1.3
                    
Install as a Cake Addin
#tool nuget:?package=Smart.Security&version=4.1.3
                    
Install as a Cake Tool

Smart.Security

NuGet

基于 BouncyCastle.Cryptography 实现的.NET安全组件库,支持数据加解密、签名验签、哈希计算、随机生成等核心功能,兼容.NET6/8/9平台。


功能特性

  • 对称加密:AES(128/256位)、国密SM4(128位分组加密)
  • 非对称加密:RSA(公钥加密/私钥解密)、国密SM2(椭圆曲线加密)
  • 哈希算法:MD5/SHA系列(SHA1/256/384/512)、HMAC系列、国密SM3
  • 密码安全:密码校验、加盐哈希、盐值生成
  • 随机数生成:安全随机字节/字符串/随机汉字
  • 文件完整性:多算法文件哈希校验

核心类说明

SmartAESCipher

  • AES对称加密/解密(CBC模式)
  • 支持128/256位密钥长度

SmartRSACipher

  • RSA公钥加密/私钥解密
  • 私钥签名/公钥验签(支持MD5/SHA1/SHA256)

SmartSM2Cipher

  • 国密SM2非对称加密(公钥加密/私钥解密)
  • 私钥签名/公钥验签(基于SM3哈希)

SmartSM4Cipher

  • 国密SM4对称加密(ECB/CBC模式)
  • 固定128位密钥和分组长度

SmartHash

  • 支持MD5/SHA1/SHA256/SHA384/SHA512
  • HMAC系列算法(HMAC-MD5/HMAC-SHA1等)

SmartFileHash

  • 文件哈希计算(MD5/SHA1/SHA256/SHA384/SHA512)
  • 大文件流式处理优化

SmartPassword

  • PBKDF2密码哈希(默认10000次迭代)
  • 自动盐值生成与验证

SmartRandom

  • 密码学安全随机数生成
  • 支持字节数组/HEX字符串/Base64字符串/随机汉字

SmartSM3Hash

  • 国密SM3哈希算法(等效SHA-256安全强度)
  • 输出32字节哈希值

平台兼容

目标框架 支持版本
.NET 6/8/9

安全建议

  1. 国密算法需配合BouncyCastle扩展使用
  2. RSA密钥长度建议≥2048位
  3. 优先使用SHA256/384/512替代MD5/SHA1
  4. 密钥应存储于安全介质(如HSM)

Developed by zenglei

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Smart.Security:

Package Downloads
BaseLibrary.ClassLibraryStand

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.1.3 139 12/30/2025
4.1.2 209 10/15/2025
4.1.1 207 7/13/2025
4.1.0 187 4/5/2025
4.0.1 250 3/23/2025
4.0.0 219 3/20/2025
3.0.2 176 2/26/2025
3.0.1 182 2/15/2025
3.0.0 167 2/15/2025
2.0.2 202 2/9/2025
2.0.1 183 12/7/2024
1.1.1 167 12/7/2024
1.1.0.2 202 11/11/2024