求一个RSA算法,可以根据in_data、n、e1,算得result的内容(200分)

  • 主题发起人 主题发起人 crazycock
  • 开始时间 开始时间
C

crazycock

Unregistered / Unconfirmed
GUEST, unregistred user!
BYTE n[]={0xcd,0xfd,0xca,0xbe,0x21,0x8e,0x6d,0x21,0x71,0xa6,0x74,0x51,0x8a,0xa1,0x41,0x8d,
0x17,0x46,0xd9,0x60,0x00,0x14,0x48,0xb6,0x7c,0x7f,0x0c,0xab,0xcb,0x34,0x61,0x86,
0xe1,0x2f,0x33,0xda,0xa0,0x2c,0xcd,0x7a,0xdb,0x3f,0x39,0x98,0x1d,0xff,0x9a,0xdd,
0x81,0x9d,0xbd,0xca,0xe8,0x78,0x88,0x1e,0xe7,0x13,0x75,0x1f,0xdf,0xfa,0x99,0xd8,
0x95,0xae,0xac,0x24,0xd9,0xd0,0xc9,0x0b,0xba,0x9d,0xe2,0xd6,0xe0,0x18,0xb4,0xad,
0x02,0x0e,0x88,0x01,0x96,0x40,0x0e,0x93,0x46,0x05,0x2a,0x5e,0xa3,0x7f,0x40,0xe1,
0x80,0x50,0x52,0x55,0x02,0xc9,0x61,0xc2,0x47,0x7d,0x35,0x59,0xe9,0xbe,0xd0,0x6c,
0xd4,0x8b,0xf0,0x7c,0x42,0xa2,0x08,0x29,0x37,0x18,0xae,0x14,0xf0,0xc5,0xb3,0x5b};

BYTE e1[]={0x1,0x0,0x1};

BYTE result[]={0x17,0x75,0xb6,0xb9,0x91,0x6d,0xf7,0xbc,0xa3,0xde,0x76,0xa2,0xa9,0xca,0xf7,0xce,
0x39,0xbf,0x23,0xb7,0xd6,0x38,0xdd,0xd1,0x9d,0x4f,0x6e,0x81,0x0e,0xf0,0xef,0x26,
0xff,0xf3,0x11,0xfe,0x3b,0x6f,0xfc,0xed,0x0f,0x19,0x58,0xda,0x99,0x07,0x6d,0x95,
0x3b,0xb1,0x51,0x22,0x64,0xcf,0x37,0x46,0xf4,0x62,0xc7,0x0b,0x54,0xeb,0xa0,0x00,
0x9d,0xde,0x0b,0xe1,0xcd,0x75,0x3b,0x18,0x01,0x73,0xd4,0x32,0x22,0x9e,0x04,0xd9,
0xca,0x49,0x64,0xc3,0xc1,0xf8,0xd9,0x96,0x19,0x88,0xc3,0xd9,0x8b,0x8d,0x70,0x62,
0xca,0xa7,0xb0,0xe0,0x00,0x82,0x2b,0x55,0xc0,0x30,0x7c,0xb0,0x69,0x40,0xd3,0xfa,
0x9b,0xe0,0x71,0x61,0x5d,0xc2,0x69,0xc4,0xdc,0xa2,0x78,0xda,0x4b,0x74,0xf3,0x2b};

BYTE out_data[128];
BYTE in_data[128];
unsigned int out_len;
memset(in_data,0,128);
memset(out_data,0,128);

in_data[0] = 0x02;

R_RSA_PUBLIC_KEY key;
key.bits = 128;
memcpy(key.modulus,n,128);
memcpy(key.exponent,e1,3);
RSAPublicBlock(out_data,&out_len,in_data,128,&key);

求一个RSA算法,可以根据in_data、n、e1,算得result的内容。
 
RSA算法的源码网上搜的到吧。
 
问题已经解决,确实是网上找到的算法,只是一直没有找到验证正确的,网上的代码,bug太多了,好不容易找到一个,竟然还暗藏了bug,幸好测试的时候发现了,给修正了。
 
恭喜。很是速度啊
 
后退
顶部