Tag: pycrypto

尝试使用Python从C#代码生成RSA签名

我正在使用别人的代码生成用于在xbox 360保存文件中进行validation的RSA签名。 代码从文件中读取所需的值并正确生成签名。 代码是: byte[] xHash=null; RSAParameters xParams = new RSAParameters(); br.BaseStream.Position = 0x1A8; xParams.D = br.ReadBytes(0x80); xParams.Exponent = br.ReadBytes(0x4); xParams.Modulus = br.ReadBytes(0x80); xParams.P = br.ReadBytes(0x40); xParams.Q = br.ReadBytes(0x40); xParams.DP = br.ReadBytes(0x40); xParams.DQ = br.ReadBytes(0x40); xParams.InverseQ = br.ReadBytes(0x40); br.close(); br=new BinaryReader(File.OpenRead(f)); br.BaseStream.Position=0x22c; xHash = new SHA1CryptoServiceProvider().ComputeHash(br.ReadBytes(0x118)); byte[] xrsa=SignatureGenerate(xParams, xHash); public static byte[] SignatureGenerate(RSAParameters xParam, byte[] […]