GmCrypto.DevToys
1.0.1.2
dotnet add package GmCrypto.DevToys --version 1.0.1.2
NuGet\Install-Package GmCrypto.DevToys -Version 1.0.1.2
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="GmCrypto.DevToys" Version="1.0.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GmCrypto.DevToys" Version="1.0.1.2" />
<PackageReference Include="GmCrypto.DevToys" />
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 GmCrypto.DevToys --version 1.0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GmCrypto.DevToys, 1.0.1.2"
#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 GmCrypto.DevToys@1.0.1.2
#: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=GmCrypto.DevToys&version=1.0.1.2
#tool nuget:?package=GmCrypto.DevToys&version=1.0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
国密工具箱(GmCrypto.DevToys)
DevToys 2.0 扩展:SM2 / SM3 / SM4 国密算法,按用途拆成 4 个工具,都位于「编码/解码(Encoders & Decoders)」分组。
NuGet 包:https://www.nuget.org/packages/GmCrypto.DevToys · 安装:DevToys → 设置 → 扩展 → 搜索「国密」或 SM3。
| 工具 | 图标 | 能力 |
|---|---|---|
| SM3 摘要 | 指纹 | 文本 Hash + 文件 Hash(流式、带进度),输出 64 位小写 Hex |
| SM4 加解密 | 挂锁 | 加密/解密切换;ECB / CBC / CTR;PKCS7 / None / Zeros;Key / IV 一键随机 |
| SM2 签名验签 | 盾牌 | 签名/验签切换;UserId(Z 值);DER 或 64 字节 raw(r‖s);一键生成密钥对 |
| SM2 加解密 | 钥匙 | 加密/解密切换;C1C3C2(国标)与 C1C2C3(老旧系统)互转 |
格式约定
- Hex:输入大小写不敏感,允许空格 /
-/:/,分隔与0x前缀;输出一律小写。 - SM2 私钥 32 字节,公钥 65 字节未压缩格式(
04开头)。 - SM2 签名 默认 DER;验签时 64 字节输入自动按 raw(r‖s) 转 DER 再验。
- SM2 密文 C1C3C2 =
C1(65) ‖ C3(32) ‖ C2(明文等长);选 C1C2C3 时自动重排字节。 - UserId(Z 值):标准默认
1234567812345678,留空即用默认。 - 编码:UTF-8 / GB18030 / ASCII;勾选「输入按 Hex 解析」时改用 Hex(解密时结果也以 Hex 输出)。
使用说明
- 参数记忆:四个工具都会记住上次的操作模式、编码、Hex / raw 开关、SM4 模式与填充、SM4 Key / IV、 SM2 私钥 / 公钥 / UserId / 签名,以及输入文本与上次输出,重启 DevToys 后原样恢复。
- SM2 密钥对:两个 SM2 工具顶部都有常显的「密钥对」卡片,加密 / 解密、签名 / 验签任何模式下都能一键生成。
- 文件摘要:目前只支持 SM3(不做 SM4 文件加密)。大文件按 8 KB 块流式计算, 能取到文件长度时按总长度显示百分比进度,否则只出结果。
- 隐私提示:私钥、公钥与输入内容会保存在本机 DevToys 设置里(
%LOCALAPPDATA%\DevToys-preview\settings.ini), 在共用电脑上使用后建议清空私钥输入框。
关于本插件
- 无第三方运行时依赖:
lib/<tfm>里只有GmCrypto.DevToys.dll,SM2 / SM3 / SM4 均为纯托管实现。 - 算法实现内联自作者的 GM 桌面程序,命名空间保持
GM.Core.*,与其他国密工具互通。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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 was computed. 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.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.