小编Yas*_*_yy的帖子

为什么Curve25519参数错误却能正确计算密钥对?

.NET (Core 3.1) 似乎支持 ECC 中的自定义曲线。所以我定义了Curve25519,并通过以下代码生成密钥对:

using System;
using System.Security.Cryptography;

namespace Curve25519
{
    class Program
    {
        static void Main(string[] args)
        {
            ECCurve ecCurve = new ECCurve() // Curve25519, 32 bytes, 256 bit
            {
                CurveType = ECCurve.ECCurveType.PrimeMontgomery,
                B = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
                A = new byte[] …
Run Code Online (Sandbox Code Playgroud)

elliptic-curve diffie-hellman curve-25519 .net-core x25519

7
推荐指数
1
解决办法
1505
查看次数