当前位置:网站首页>[C language] MD5 encryption for account password
[C language] MD5 encryption for account password
2022-07-03 02:47:00 【I&You】
Give the account password MD5 encryption
The source code parsing
//md5 Encrypt user password
UtlMd5_t ctx;
unsigned char serverDigest[16];
utl_md5_init(&ctx);
//md5 initialization
utl_md5_update(&ctx, "admin", strlen("admin"));
// Pass the encrypted information to the initialized MD5 Structure , No return value
// Cross account
utl_md5_update(&ctx, "debug_get_vs_status", strlen("debug_get_vs_status"));
// Transmit control instructions
utl_md5_update(&ctx, "admin123", strlen("admin123"));
// Pass the code
utl_md5_final(&ctx, serverDigest);
// convert to 32 Bit 16 Base string
int i=0;
unsigned char decrypt32[64]={
0};
char temp[8]={
0};
for(i=0;i<16;i++)
{
sprintf(temp,"%02x",serverDigest[i]);// Convert hex to string %x=0x6b ==> %s="6b"
strcat((char *)decrypt32,temp);
}
// Last generated decrypt32 That is to say md5 Encrypted password :"6be7c69c5cdf177753270cf390ef1e90"
// Successfully sent
/*
Content-Length: 133
Content-Type: application/json;charset=utf-8
Connection: close
{
"method": "debug_get_vs_status",
"param": {
},
"user": {
"name": "admin",
"digest": "6be7c69c5cdf177753270cf390ef1e90"
}
} Send successfully length 251!
Response message header :
*******************************
HTTP/1.1 200 OK
Content-Length: 1640
Content-Type: application/json;charset=utf-8
Connection: close
*/
Source download
边栏推荐
- 为什么会选择框架?选择什么样的框架
- C语言初阶-指针详解-庖丁解牛篇
- Kubernetes cluster log and efk architecture log scheme
- Source code analysis | resource loading resources
- [fluent] listview list (map method description of list set | vertical list | horizontal list | code example)
- Gbase 8C system table PG_ amproc
- Baidu map - surrounding search
- Can netstat still play like this?
- What does "where 1=1" mean
- ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
猜你喜欢

Joking about Domain Driven Design (III) -- Dilemma

基于can总线的A2L文件解析(2)

Le processus de connexion mysql avec docker

超好用的日志库 logzero

迅雷chrome扩展插件造成服务器返回的数据js解析页面数据异常

Can netstat still play like this?

Deep Reinforcement Learning for Intelligent Transportation Systems: A Survey 论文阅读笔记

A2L file parsing based on CAN bus (2)

一文带你了解 ZigBee

Kubernetes cluster log and efk architecture log scheme
随机推荐
Can netstat still play like this?
"Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b
Your family must be very poor if you fight like this!
The difference between left value and right value in C language
疫情当头,作为Leader如何进行代码版本和需求开发管控?| 社区征文
面试项目技术栈总结
Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)
C语言中左值和右值的区别
Global and Chinese ammonium dimolybdate market in-depth analysis and prospect risk prediction report 2022 Edition
Interview stereotyped version
The Linux server needs to install the agent software EPS (agent) database
Gbase 8C system table PG_ attribute
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)
Kubernetes family container housekeeper pod online Q & A?
为什么会选择框架?选择什么样的框架
Check log4j problems using stain analysis
How to change the panet layer in yolov5 to bifpn
【翻译】后台项目加入了CNCF孵化器
Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
Baidu map - surrounding search