在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 5312|回复: 4

[原创] NCSIM rc5 decrypt

[复制链接]
发表于 2016-4-12 03:14:51 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
One of the encryption shemes in NCSIM is utilizingRC5 to encrypt the keyblock. The encrypted part ismarked with// Pragma protect key_keyname = CDS_KEY// Pragma protect key_method = RC5style directives.The key_block section that this scheme RC5 encryptsis a text snippet that in term includes the encryption methodof the data_block, normally it is AES and the AES key.An example of the key_block section:--------- Before decrypt -----------// Pragma protect key_blockcpuqmTjFp2LUUeeTQCmjXOtQIYdyxp0M4cUOb1KoZjg + IZHFIf / lII1Gcm36dPgTdOL8xO0E1LGVCab1wSMzG9r5keP4bLvlYgPV / xfFb + kJ3xprGZJwz2L9HjIX4NhCafDnbYui0WnFdgCie / wO3qZOwTPUnTzSsQ / mohys88s5 + 6CDx9iJ0w ==// Pragma protect end_key_block-------------------------------------------- After decrypt -----------@fbaWIKWEo [NCP: ENG_VER = 1.100000]// Pragma protect data_method = AES// Pragma protect data_decrypt_keyxSzOPdVsfyMAAAAAAAAA ==-----------------------------------Here is the keys / method to decrypt it:NCSIM uses RC5_CBC. This is similar to AES_CBS inthat it runs a decrypt round and a final xor using. A runtime vector The RC5_CBC parameters are:RC5 key: 96e8dfd8354fb228RC5_CBC iv: 636164656e636500RC5 rounds: 0x14For the AES key that is inside the key_block sectionthe initialization vector used by aes_cbc is:AES iv: 636164656e63652064657369676e2073The RC5 keyschedule is standard RC5 In OpenSSL terminology.:RC5_32_set_key (& key, 8, d, 20);(Note that OpenSSL does only implement RC5 up to RC5_16_ROUNDS,you have to patch OpenSSL to increase the supported RC5 roundsand unroll RC5_32_decrypt to support it. Note also that youneed to use linux-x32 so that "long int" is 32 bit)The decrypt is again standard RC5, in Openssl terminology:RC5_32_decrypt (p, & key);where 2 ints are decrypted on each call.The complete RC5_CBC algo used by ncsim:  unsigned int * p = ..; int len = ..;  char key [] = {0x96, 0xe8, 0xdf, 0xd8, 0x35, 0x4f, 0xb2, 0x28};  unsigned long iv0 = 0x65646163; / * cade * /  unsigned long iv1 = 0x0065636e; / * nce \ 0 * /  RC5_32_set_key (& key, 8, d, 20);  for (i = 0; i <len; i + = 2) {    unsigned int o0, o1;    o0 = p [i + 0];    o1 = p [i + 1];    RC5_32_decrypt (p + i, & key);    p [i + 0] ^ = iv0;    p [i + 1] ^ = iv1;    iv0 = o0;    iv1 = o1;  }
发表于 2016-4-16 13:21:14 | 显示全部楼层
Good day! Thank you very much for your posts.
One addittional question:
Do you know method to work with core
encrypted by SYNP05_001 key, rsa?
发表于 2016-5-14 22:44:54 | 显示全部楼层
Could you share the modified RC5 source code? I tried but the decryption is wrong, not sure it is the key or RC5 problem.
发表于 2016-5-25 06:22:30 | 显示全部楼层
how to open gui
发表于 2022-2-28 10:56:49 | 显示全部楼层
本帖最后由 3082813 于 2022-3-1 20:42 编辑

The key is not correct.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-3-28 23:39 , Processed in 0.021673 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表