C语言实现DES加解密算法

C语言实现DES加解密算法

    • DES加解密

DES加解密

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*--------------------------------------------------------------------------------------------------------------*/
typedef unsigned char ubyte;
/*--------------------------------------------------------------------------------------------------------------*/
#define KEY_LEN 8
typedef ubyte key_t[KEY_LEN];
/*--------------------------------------------------------------------------------------------------------------*/
const static ubyte PC1[] = {57, 49, 41, 33, 25, 17,  9,1, 58, 50, 42, 34, 26, 18,10,  2, 59, 51, 43, 35, 27,19, 11,  3, 60, 52, 44, 36,63, 55, 47, 39, 31, 23, 15,7, 62, 54, 46, 38, 30, 22,14,  6, 61, 53, 45, 37, 29,21, 13,  5, 28, 20, 12,  4
};
/*--------------------------------------------------------------------------------------------------------------*/
const static ubyte PC2[] = {14, 17, 11, 24,  1,  5,3, 28, 15,  6, 21, 10,23, 19, 12,  4, 26,  8,16,  7, 27, 20, 13,  2,41, 52, 31, 37, 47, 55,30, 40, 51, 45, 33, 48,44, 49, 39, 56, 34, 53,46, 42, 50, 36, 29, 32
};
/*--------------------------------------------------------------------------------------------------------------*/
const static ubyte IP[] = {58, 50, 42, 34, 26, 18, 10,  2,60, 52, 44, 36, 28, 20, 12,  4,62, 54, 46, 38, 30, 22, 14,  6,64, 56, 48, 40, 32, 24, 16,  8,57, 49, 41, 33, 25, 17,  9,  1,59, 51, 43, 35, 27, 19, 11,  3,61, 53, 45, 37, 29, 21, 13,  5,63, 55, 47, 39, 31, 23, 15,  7
};
/*--------------------------------------------------------------------------------------------------------------*/
const static ubyte E[] = {32,  1,  2,  3,  4,  5,4,  5,  6,  7,  8,  9,8,  9, 10, 11, 12, 13,12, 13, 14, 15, 16, 17,16, 17, 18, 19, 20, 21,20, 21, 22, 23, 24, 25,24, 25, 26, 27, 28, 29,28, 29, 30, 31, 32,  1
};
/*--------------------------------------------------------------------------------------------------------------*/
const static ubyte S[][64] = {{14,  4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7,0, 15,  7,  4, 14,  2, 13,  1, 10,  6, 12, 11,  9,  5,  3,  8,4,  1, 14,  8, 13,  6,  2, 11, 15, 12,  9,  7,  3, 10,  5,  0,15, 12,  8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13},{15,  1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10,3, 13,  4,  7, 15,  2,  8, 14, 12,  0,  1, 10,  6,  9, 11,  5,0, 14,  7, 11, 10,  4, 13,  1,  5,  8, 12,  6,  9,  3,  2, 15,13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14,  9},{10,  0,  9, 14,  6,  3, 15,  5,  1, 13, 12,  7, 11,  4,  2,  8,13,  7,  0,  9,  3,  4,  6, 10,  2,  8,  5, 14, 12, 11, 15,  1,13,  6,  4,  9,  8, 15,  3,  0, 11,  1,  2, 12,  5, 10, 14,  7,1, 10, 13,  0,  6,  9,  8,  7,  4, 15, 14,  3, 11,  5,  2, 12},{7, 13, 14,  3,  0,  6,  9, 10,  1,  2,  8,  5, 11, 12,  4, 15,13,  8, 11,  5,  6, 15,  0,  3,  4,  7,  2, 12,  1, 10, 14,  9,10,  6,  9,  0, 12, 11,  7, 13, 15,  1,  3, 14,  5,  2,  8,  4,3, 15,  0,  6, 10,  1, 13,  8,  9,  4,  5, 11, 12,  7,  2, 14},{2, 12,  4,  1,  7, 10, 11,  6,  8,  5,  3, 15, 13,  0, 14,  9,14, 11,  2, 12,  4,  7, 13,  1,  5,  0, 15, 10,  3,  9,  8,  6,4,  2,  1, 11, 10, 13,  7,  8, 15,  9, 12,  5,  6,  3,  0, 14,11,  8, 12,  7,  1, 14,  2, 13,  6, 15,  0,  9, 10,  4,  5,  3},{12,  1, 10, 15,  9,  2,  6,  8,  0, 13,  3,  4, 14,  7,  5, 11,10, 15,  4,  2,  7, 12,  9,  5,  6,  1, 13, 14,  0, 11,  3,  8,9, 14, 15,  5,  2,  8, 12,  3,  7,  0,  4, 10,  1, 13, 11,  6,4,  3,  2, 12,  9,  5, 15, 10, 11, 14,  1,  7,  6,  0,  8, 13},{4, 11,  2, 14, 15,  0,  8, 13,  3, 12,  9,  7,  5, 10,  6,  1,13,  0, 11,  7,  4,  9,  1, 10, 14,  3,  5, 12,  2, 15,  8,  6,1,  4, 11, 13, 12,  3,  7, 14, 10, 15,  6,  8,  0,  5,  9,  2,6, 11, 13,  8,  1,  4, 10,  7,  9,  5,  0, 15, 14,  2,  3, 12},{13,  2,  8,  4,  6, 15, 11,  1, 10,  9,  3, 14,  5,  0, 12,  7,1, 15, 13,  8, 10,  3,  7,  4, 12,  5,  6, 11,  0, 14,  9,  2,7, 11,  4,  1,  9, 12, 14,  2,  0,  6, 10, 13, 15,  3,  5,  8,2,  1, 14,  7,  4, 10,  8, 13, 15, 12,  9,  0,  3,  5,  6, 11}
};
/*--------------------------------------------------------------------------------------------------------------*/
const static ubyte P[] = {16,  7, 20, 21,29, 12, 28, 17,1, 15, 23, 26,5, 18, 31, 10,2,  8, 24, 14,32, 27,  3,  9,19, 13, 30,  6,22, 11,  4, 25
};
/*--------------------------------------------------------------------------------------------------------------*/
const static ubyte IP2[] = {40,  8, 48, 16, 56, 24, 64, 32,39,  7, 47, 15, 55, 23, 63, 31,38,  6, 46, 14, 54, 22, 62, 30,37,  5, 45, 13, 53, 21, 61, 29,36,  4, 44, 12, 52, 20, 60, 28,35,  3, 43, 11, 51, 19, 59, 27,34,  2, 42, 10, 50, 18, 58, 26,33,  1, 41,  9, 49, 17, 57, 25
};
/*--------------------------------------------------------------------------------------------------------------*/
const static ubyte SHIFTS[] = {1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1
};
/*--------------------------------------------------------------------------------------------------------------*/
typedef struct {ubyte *data;int len;
} String;
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Transform a single nibble into a hex character
*
* in: a value < 0x10
*
* returns: the character that represents the nibble
*/
static char toHex(ubyte in) {if (0x00 <= in && in < 0x0A) {return '0' + in;}if (0x0A <= in && in <= 0x0F) {return 'A' + in - 0x0A;}return 0;
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Convert an array of bytes into a string
*
* ptr: the array of bytes
* len: the number of bytes
* out: a buffer allocated by the caller with enough space for 2*len+1 characters
*/
static void printBytes(const ubyte *ptr, int len, char *out) {while (len-- > 0) {*out++ = toHex(*ptr >> 4);*out++ = toHex(*ptr & 0x0F);ptr++;}*out = 0;
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Gets the value of a bit in an array of bytes
*
* src: the array of bytes to index
* index: the desired bit to test the value of
*
* returns: the bit at the specified position in the array
*/
static int peekBit(const ubyte *src, int index) {int cell = index / 8;int bit = 7 - index % 8;return (src[cell] & (1 << bit)) != 0;
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Sets the value of a bit in an array of bytes
*
* dst: the array of bits to set a bit in
* index: the position of the bit to set
* value: the value for the bit to set
*/
static void pokeBit(ubyte *dst, int index, int value) {int cell = index / 8;int bit = 7 - index % 8;if (value == 0) {dst[cell] &= ~(1 << bit);}else {dst[cell] |= (1 << bit);}
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Transforms one array of bytes by shifting the bits the specified number of positions
*
* src: the array to shift bits from
* len: the length of the src array
* times: the number of positions that the bits should be shifted
* dst: a bytes array allocated by the caller to store the shifted values
*/
static void shiftLeft(const ubyte *src, int len, int times, ubyte *dst) {int i, t;for (i = 0; i <= len; ++i) {pokeBit(dst, i, peekBit(src, i));}for (t = 1; t <= times; ++t) {int temp = peekBit(dst, 0);for (i = 1; i <= len; ++i) {pokeBit(dst, i - 1, peekBit(dst, i));}pokeBit(dst, len - 1, temp);}
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Calculates the sub keys to be used in processing the messages
*
* key: the array of bytes representing the key
* ks: the subkeys that have been allocated by the caller
*/
typedef ubyte subkey_t[17][6]; /* 17 sets of 48 bits */
static void getSubKeys(const key_t key, subkey_t ks) {ubyte c[17][7];  /* 56 bits */ubyte d[17][4];  /* 28 bits */ubyte kp[7];int i, j;/* intialize */memset(c, 0, sizeof(c));memset(d, 0, sizeof(d));memset(ks, 0, sizeof(subkey_t));/* permute 'key' using table PC1 */for (i = 0; i < 56; ++i) {pokeBit(kp, i, peekBit(key, PC1[i] - 1));}/* split 'kp' in half and process the resulting series of 'c' and 'd' */for (i = 0; i < 28; ++i) {pokeBit(c[0], i, peekBit(kp, i));pokeBit(d[0], i, peekBit(kp, i + 28));}/* shift the components of c and d */for (i = 1; i < 17; ++i) {shiftLeft(c[i - 1], 28, SHIFTS[i - 1], c[i]);shiftLeft(d[i - 1], 28, SHIFTS[i - 1], d[i]);}/* merge 'd' into 'c' */for (i = 1; i < 17; ++i) {for (j = 28; j < 56; ++j) {pokeBit(c[i], j, peekBit(d[i], j - 28));}}/* form the sub-keys and store them in 'ks'* permute 'c' using table PC2 */for (i = 1; i < 17; ++i) {for (j = 0; j < 48; ++j) {pokeBit(ks[i], j, peekBit(c[i], PC2[j] - 1));}}
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Function used in processing the messages
*
* r: an array of bytes to be processed
* ks: one of the subkeys to be used for processing
* sp: output from the processing
*/
static void f(ubyte *r, ubyte *ks, ubyte *sp) {ubyte er[6]; /* 48 bits */ubyte sr[4]; /* 32 bits */int i;/* initialize */memset(er, 0, sizeof(er));memset(sr, 0, sizeof(sr));/* permute 'r' using table E */for (i = 0; i < 48; ++i) {pokeBit(er, i, peekBit(r, E[i] - 1));}/* xor 'er' with 'ks' and store back into 'er' */for (i = 0; i < 6; ++i) {er[i] ^= ks[i];}/* process 'er' six bits at a time and store resulting four bits in 'sr' */for (i = 0; i < 8; ++i) {int j = i * 6;int b[6];int k, row, col, m, n;for (k = 0; k < 6; ++k) {b[k] = peekBit(er, j + k) != 0 ? 1 : 0;}row = 2 * b[0] + b[5];col = 8 * b[1] + 4 * b[2] + 2 * b[3] + b[4];m = S[i][row * 16 + col]; /* apply table s */n = 1;while (m > 0) {int p = m % 2;pokeBit(sr, (i + 1) * 4 - n, p == 1);m /= 2;n++;}}/* permute sr using table P */for (i = 0; i < 32; ++i) {pokeBit(sp, i, peekBit(sr, P[i] - 1));}
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Processing of block of the message
*
* message: an 8 byte block from the message
* ks: the subkeys to use in processing
* ep: space for an encoded 8 byte block allocated by the caller
*/
static void processMessage(const ubyte *message, subkey_t ks, ubyte *ep) {ubyte left[17][4];  /* 32 bits */ubyte right[17][4]; /* 32 bits */ubyte mp[8];        /* 64 bits */ubyte e[8];         /* 64 bits */int i, j;/* permute 'message' using table IP */for (i = 0; i < 64; ++i) {pokeBit(mp, i, peekBit(message, IP[i] - 1));}/* split 'mp' in half and process the resulting series of 'l' and 'r */for (i = 0; i < 32; ++i) {pokeBit(left[0], i, peekBit(mp, i));pokeBit(right[0], i, peekBit(mp, i + 32));}for (i = 1; i < 17; ++i) {ubyte fs[4]; /* 32 bits */memcpy(left[i], right[i - 1], 4);f(right[i - 1], ks[i], fs);for (j = 0; j < 4; ++j) {left[i - 1][j] ^= fs[j];}memcpy(right[i], left[i - 1], 4);}/* amalgamate r[16] and l[16] (in that order) into 'e' */for (i = 0; i < 32; ++i) {pokeBit(e, i, peekBit(right[16], i));}for (i = 32; i < 64; ++i) {pokeBit(e, i, peekBit(left[16], i - 32));}/* permute 'e' using table IP2 ad return result as a hex string */for (i = 0; i < 64; ++i) {pokeBit(ep, i, peekBit(e, IP2[i] - 1));}
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Encrypts a message using DES
*
* key: the key to use to encrypt the message
* message: the message to be encrypted
* len: the length of the message
*
* returns: a paring of dynamically allocated memory for the encoded message,
*          and the length of the encoded message.
*          the caller will need to free the memory after use.
*/
String encrypt(const key_t key, const ubyte *message, int len) {String result = { 0, 0 };subkey_t ks;ubyte padByte;int i;getSubKeys(key, ks);padByte = 8 - len % 8;result.len = len + padByte;result.data = (ubyte*)malloc(result.len);memcpy(result.data, message, len);memset(&result.data[len], padByte, padByte);for (i = 0; i < result.len; i += 8) {processMessage(&result.data[i], ks, &result.data[i]);}return result;
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Decrypts a message using DES
*
* key: the key to use to decrypt the message
* message: the message to be decrypted
* len: the length of the message
*
* returns: a paring of dynamically allocated memory for the decoded message,
*          and the length of the decoded message.
*          the caller will need to free the memory after use.
*/
String decrypt(const key_t key, const ubyte *message, int len) {String result = { 0, 0 };subkey_t ks;int i, j;ubyte padByte;getSubKeys(key, ks);/* reverse the subkeys */for (i = 1; i < 9; ++i) {for (j = 0; j < 6; ++j) {ubyte temp = ks[i][j];ks[i][j] = ks[17 - i][j];ks[17 - i][j] = temp;}}result.data = (ubyte*)malloc(len);memcpy(result.data, message, len);result.len = len;for (i = 0; i < result.len; i += 8) {processMessage(&result.data[i], ks, &result.data[i]);}padByte = result.data[len - 1];result.len -= padByte;return result;
}
/*--------------------------------------------------------------------------------------------------------------*/
/*
* Convienience method for showing the round trip processing of a message
*/
void driver(const key_t key, const ubyte *message, int len) {String encoded, decoded;char buffer[128];printBytes(key, KEY_LEN, buffer);printf("Key     : %s\n", buffer);printBytes(message, len, buffer);printf("Message : %s\n", buffer);encoded = encrypt(key, message, len);printBytes(encoded.data, encoded.len, buffer);printf("Encoded : %s\n", buffer);decoded = decrypt(key, encoded.data, encoded.len);printBytes(decoded.data, decoded.len, buffer);printf("Decoded : %s\n\n", buffer);/* release allocated memory */if (encoded.len > 0) {free(encoded.data);encoded.data = 0;}if (decoded.len > 0) {free(decoded.data);decoded.data = 0;}
}
/*--------------------------------------------------------------------------------------------------------------*/
void main()
{String decoded;int len;//密钥const key_t key = { 97, 98, 99, 100, 101, 102, 103, 104 };//密文const ubyte data[] = { 18, 160, 16, 191, 146, 60, 89, 222, 238, 164, 90, 7, 250, 217, 139, 223 };//密文长度len = sizeof(data) / sizeof(ubyte);decoded = decrypt(key, data, len);printf("Decoded:%s\n", decoded.data);//释放内存if (decoded.len > 0) {free(decoded.data);decoded.data = 0;}return;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/438026.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

33种编程语言为您送上祝福,新年快乐!

又是新的一年&#xff0c;没什么好说的&#xff0c;就用33种编程语言为大家送上祝福吧&#xff01;Cprintf("2019&#xff0c;祝大家");Ccout<<"一帆风顺";C#System.Console.WriteLine("二龙腾飞")VBMsg("三羊开泰")VCMessageBo…

IsPostBack须要注意的地方,这些都不是POSTBACK动作

page.IsPostBack属性 简要概述: IsPostBack 字面意思理解为:是回滚,那如果不是回滚,那就是首次加载! (!page.ispostback)理解为:不是回滚,值为:true. if(!page.ispostback) //首次加载 { //如果是第一次加载,就执行此内容. } else{非首次加载页面} 1 IsPostBack介…

C语言实现RC4加解密算法

C语言实现RC4加解密算法RC4加解密RC4加解密 #include<stdio.h>/* RC4初始化函数 */ void rc4_init(unsigned char* s, unsigned char* key, unsigned long Len_k) {int i 0, j 0;char k[256] { 0 };unsigned char tmp 0;for (i 0; i < 256; i) {s[i] i;k[i] k…

element.style内联样式修改

最近在修改我个人博客的一个样式时发现&#xff0c;无论我如何修改style里面的值&#xff0c;页面上的样式都不会被修改&#xff0c;F12检查一下发现个element.style&#xff0c;但是却找不到这个值在哪里&#xff0c;查资料后才知道element.style为内联样式&#xff0c;基本很…

if(!ispostback)其用法和作用 什么时候该用?

&#xff08;1&#xff09;if (!IsPostBack) 里面的代码只执行一遍&#xff0c;即页面第一次加载时。 &#xff08;2&#xff09;以后页面重新刷新时&#xff0c;if (!IsPostBack)里面的语句不执行。 &#xff08;3&#xff09;首次建立页面 IsPostBack为false&#xff0c;用来…

C语言实现SM4加解密算法

C语言实现SM4加解密算法SM4加解密SM4加解密 #include <string.h> #include <stdio.h> #include <time.h> /*--------------------------------------------------------------------------------------------------------------*/ #define SM4_ENCRYPT …

免费CDN:jsDelivr+Github 使用方法

CDN的全称是Content Delivery Network&#xff0c;即内容分发网络。CDN是构建在网络之上的内容分发网络&#xff0c;依靠部署在各地的边缘服务器&#xff0c;通过中心平台的负载均衡、内容分发、调度等功能模块&#xff0c;使用户就近获取所需内容&#xff0c;降低网络拥塞&…

EasyUI学习总结(一)——EasyUI入门

一、EasyUI下载 EasyUI官方下载地址&#xff1a;http://www.jeasyui.com/download/index.php&#xff0c;目前最新的版本是&#xff1a;jQuery EasyUI 1.4.1 下载完成之后&#xff0c;得到压缩包&#xff0c;解压后&#xff0c;得到一个【jquery-easyui-1.4.1】文件夹&#xff…

PWN-PRACTICE-CTFSHOW-1

PWN-PRACTICE-CTFSHOW-1PWN签到题pwn02pwn03pwn04PWN签到题 nc连上去就会打印flag pwn02 栈溢出&#xff0c;覆盖返回地址为后门函数stack起始地址即可 # -*- coding:utf-8 -*- from pwn import * #ioprocess("./pwn1") ioremote("pwn.challenge.ctf.show&…

利用QQ邮箱设置个性域名邮箱,并在网易邮箱大师客户端添加域名邮箱

平常我们使用的邮箱都是xxxqq.com、xxx126.com、xxx163.com、xxxgmail.com之类的&#xff0c;这些邮箱会暴露你的QQ号、电话号等信息&#xff0c;最重要的是后缀都和别人一样&#xff0c;没有个性&#xff0c;也许你看见过xxxliruihao.com、xxxwangxiaoxiao.com之类的带有个性后…

MVC和WebForm区别

WebForm的理解 1、 WebForm概念 ASP.NETWebform提供了一个类似于Winform的事件响应GUI模型&#xff08;event-drivenGUI&#xff09;&#xff0c;隐藏了HTTP、HTML、JavaScript等细节&#xff0c;将用户界面构建成一个服务器端的树结构控件&#xff08;Control&#xff09;&a…

PWN-PRACTICE-CTFSHOW-2

PWN-PRACTICE-CTFSHOW-2pwn05pwn06pwn0701栈溢出之ret2textpwn05 栈溢出&#xff0c;覆盖返回地址为后门函数getFlag起始地址即可 # -*- coding:utf-8 -*- from pwn import * context.log_level"debug" #ioprocess("./pwn1") ioremote("pwn.challen…

VMware Pro 15 安装 Deepin15.9 国产操作系统详细教程

Deepin是由武汉深之度科技有限公司开发的Linux发行版&#xff0c;个人认为其界面设计非常美观&#xff0c;而且作为国产操作系统&#xff0c;值得我们去体验和支持&#xff01; 文章目录1.下载安装 VMware Workstation Pro 152.下载 Deepin15.9 系统3.在 VMware 中创建虚拟机4.…

Asp.Net WebForm生命周期的详解

一&#xff0e;http://Asp.Net页面生命周期的概念 当我们在浏览器地址栏中输入网址&#xff0c;回车查看页面时&#xff0c;这时会向服务器端IIS&#xff09;发送一个request请求&#xff0c;服务器就会判断发送过来的请求页面&#xff0c;当完全识别 TTP页面处理程序类后&…

PWN-PRACTICE-CTFSHOW-3

PWN-PRACTICE-CTFSHOW-3pwn10萌新赛-签到题萌新赛-数学99内部赛-签到题pwn10 格式化字符串漏洞&#xff0c;覆写num为16即可打印出flag # -*- coding:utf-8 -*- from pwn import * context.log_level"debug" #ioprocess("./pwn1") ioremote("pwn.ch…

Python PEP8 代码规范常见问题及解决方法

之前一直用 Python IDLE 写代码&#xff0c;最近换成 PyCharm 写代码总是会出现波浪号&#xff0c;这才了解到 Python 的 PEP8 代码规范&#xff0c;所以将常见的 PEP8 代码规范问题和解决方法记录一下&#xff0c;学习一下&#xff0c;遇到了再持续更新&#xff0c;养成良好的…

基于.NET平台的分层架构实战(一)——综述

通过浏览博客园的文章发现&#xff0c;很多朋友对分层架构特别感兴趣&#xff0c;刚好我刚做完的毕业设计就是专门研究.NET平台上分层架构的&#xff08;题目叫“基于.NET平台的分层架构与设计模式应用研究”&#xff09;。通过做这篇论文&#xff0c;我对分层架构有了一定的了…

Eclipse 通过 JDBC 连接 SQL Server

文章目录1.配置 SQL Server 20122.开启 Telnet 服务3.测试1433端口是否打开4.下载JDBC5.Eclipse 连接 SQL Server6.测试连接本文用到的软件版本以及相关环境&#xff1a; Eclipse Photon Release (4.8.0) JDK-10.0.2 SQL Server 2012 1.配置 SQL Server 2012 打开 SQL Server …

PWN-PRACTICE-CTFSHOW-4

PWN-PRACTICE-CTFSHOW-4BJDCTF2020-babyrouterBJDCTF2020-babystackBJDCTF2020-dizzyBJDCTF2020-encryptde stackBJDCTF2020-babyrouter 栈溢出&#xff0c;ret2libc # -*- coding:utf-8 -*- from pwn import * context.log_level"debug" #ioprocess("./pwn1&…

SQL Server 登录更换【Windows身份验证】为【SQL Server 身份验证】

1、安装好 SQL Server 后&#xff0c;使用 Windows 身份验证登陆SQL&#xff0c;然后在服务器上右键&#xff0c;选择【属性】&#xff0c;在弹出的窗口中选择【安全性】&#xff0c;在服务器身份验证项里勾选【SQL Server 和 Windows 身份验证模式】&#xff0c;点击确定保存 …