我是 python 和密码学的新手。我想从变量生成 PrivateKey。在寻找了这么多选项之后,我才知道我只能从Random
函数生成密钥对。
这是我的变量
a = [[[3, 1, 85, 33, 0, 0, 255, 254, 255, 254, 255, 254, 255, 254, 255, 6, 248, 0, 240, 0, 224, 0, 192, 0, 192, 0, 128, 0, 128, 0, 128, 0, 128, 0, 128, 0, 128, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 181, 11, 254, 92, 186, 205, 94, 27, 192, 36, 126, 26, 164, 13, 159, 114, 59, 162, 95, 50, 189, 78, 95, 99, 24, 140, 124, 72, 165, 204, 156, 114, 40, 99, 28, 57, 25, 141, 122, 107, 39, 226, 122, 24, 169, 35, 186, 93, 39, 162, 242, 24, 185, 229, 120, 38, 169, 205, 57, 31, 184, 141, 153, 78, 152, 12, 86, 92, 152, 13, 22, 77, 155, 226, 182, 66, 163, 163, 16, 89, 157, 227, 180, 67, 160, 204, 142, 101, 165, 226, 244, 45, 167, 99, 20, 117, 157, 76, 44, 38, 181, 225, 44, 107, 32, 75, 179, 110, 32, 163, 16, 38, 165, 101, 48, 32, 43, 14, 76, 38, 50, 204, 205, 50, 163, 227, 172, 38, 46, 98, 108, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 1, 101, 34, 0, 0, 255, 254, 255, 14, 248, 2, 240, 2, 224, 0, 192, 0, 192, 0, 128, 0, 128, 0, 128, 0, 128, 0, 192, 0, 192, 0, 224, 0, 224, 0, 240, 0, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 17, 229, 30, 78, 19, 140, 30, 99, 21, 226, 190, 113, 22, 97, 190, 30, 152, 36, 94, 115, 162, 75, 222, 21, 35, 228, 126, 119, 168, 97, 222, 99, 40, 140, 222, 32, 52, 14, 222, 108, 53, 204, 94, 67, 55, 78, 222, 76, 193, 100, 62, 57, 172, 142, 31, 92, 181, 77, 191, 47, 55, 101, 31, 119, 184, 75, 63, 75, 11, 22, 92, 108, 15, 227, 156, 44, 157, 34, 28, 25, 158, 13, 220, 32, 33, 228, 92, 35, 165, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]]
所以我的问题是,
- 是否可以从序列/数据生成 PrivateKey
- 如果是这样,任何关于我该如何继续的建议
- 最后但并非最不重要的一点是,我应该使用哪种算法(RSA/ECC)