对称加密算法之DES介绍

2023-05-16

      DES(Data Encryption Standard)是分组对称密码算法DES采用了64位的分组长度和56位的密钥长度,它将64位的输入经过一系列变换得到64位的输出。解密则使用了相同的步骤和相同的密钥。DES的密钥长度为64位,由于第n*8(n=1,2,…8)是校验位,因此实际参与加密的长度为56位,密钥空间含有2^56个密钥。

      DES算法利用多次组合替代算法和换位算法,分散和错乱的相互作用,把明文编制成密码强度很高的密文,它的加密和解密用的是同一算法。

      DES算法,是一种乘积密码,其在算法结构上主要采用了置换、代替、模二相加等函数,通过轮函数迭代的方式来进行计算和工作。

      DES算法也会使用到数据置换技术,主要有初始置换IP和逆初始置换IP^-1两种类型。DES算法使用置换运算的目的是将原始明文的所有格式及所有数据全部打乱重排。而在轮加密函数中,即将数据全部打乱重排,同时在数据格式方面,将原有的32位数据格式,扩展成为48位数据格式,目的是为了满足S盒组对数据长度和数据格式规范的要求。

      一组数据信息经过一系列的非线性变换以后,很难从中推导出其计算的过程和使用的非线性组合;但是如果这组数据信息使用的是线性变换,计算就容易的多。在DES算法中,属于非线性变换的计算过程只有S盒,其余的数据计算和变换都是属于线性变换,所以DES算法安全的关键在于S盒的安全强度。此外,S盒和置换IP相互配合,形成了很强的抗差分攻击和抗线性攻击能力,其中抗差分攻击能力更强一些。

      DES算法是一种分组加密机制,将明文分成N个组,然后对各个组进行加密,形成各自的密文,最后把所有的分组密文进行合并,形成最终的密文

      DES加密是对每个分组进行加密,所以输入的参数为分组明文和密钥,明文分组需要置换和迭代,密钥也需要置换和循环移位。在初始置换IP中,根据一张8*8的置换表,将64位的明文打乱、打杂,从而提高加密的强度;再经过16次的迭代运算,在这些迭代运算中,要运用到子密钥;每组形成的初始密文,再次经过初始逆置换IP^-1,它是初始置换的逆运算,最后得到分组的最终密文。

图1 DES流程图

      图1左半部分,DES对明文的处理经过了三个阶段。首先,64位的明文经过初始置换(IP)而被重新排列。而后进行16轮的相同函数的作用,每轮的作用都有置换和代换。最后一轮迭代的输出有64位,它是输入明文和密钥的函数。将其左半部分和右半部分互换产生预输出。最后,预输出再与初始置换(IP)互逆的逆初始置换(IP^-1)作用产生64位的密文。

      图2右半部分,给出了作用56比特密钥的过程。DES算法的加密密钥是64比特,但是由于密钥的第n*8(n=1,2…8)是校验(保证含有奇数个1),因此实际参与加密的的密钥只有56比特。开始时,密钥经过一个置换,然后经过循环左移和另一个置换分别得到子密钥ki,供每一轮的迭代加密使用。每轮的置换函数都一样,但是由于密钥位的重复迭代使得子密钥互不相同

      DES算法利用多次组合替代算法和换位算法,分散和错乱的相互作用,把明文编制成密码强度很高的密文,它的加密和解密用的是同一算法。

      DES算法详述:DES对64位明文分组(密钥56bit)进行操作。

      1. 初始置换函数IP:64位明文分组x经过一个初始置换函数IP,产生64位的输出x0,再将分组x0分成左半部分L0和右半部分R0:即将输入的第58位换到第一位,第50位换到第2位,…,依次类推,最后一位是原来的第7位。L0、R0则是换位输出后的两部分,L0是输出的左32位,R0是右32位。例,设置换前的输入值为D1D2D3…D64,则经过初始置换后的结果为:L0=D58D50…D8;R0=D57D49…D7.其置换规则如表1所示。

      DES加密过程最后的逆置换IP^-1,是表1的逆过程。就是把原来的每一位都恢复过去,即把第1位的数据,放回到第58位,把第2位的数据,放回到第50位。

表 1

      2. 获取子密钥Ki:DES加密算法的密钥长度为56位,一般表示为64位(每个第8位用于奇偶校验),将用户提供的64位初始密钥经过一系列的处理得到K1,K2,…,K16,分别作为1~16轮运算的16个子密钥。

      (1). 将64位密钥去掉8个校验位,用密钥置换PC-1(表2)置换剩下的56位密钥;

表2

      (2). 将56位分成前28位C0和后28位D0,即PC-1(K56)=C0D0;

      (3). 根据轮数,这两部分分别循环左移1位或2位,表3:

表3

      (4). 移动后,将两部分合并成56位后通过压缩置换PC-2(表4)后得到48位子密钥,即Ki=PC-2(CiDi).

表4

      子密钥产生如图2所示:

 图2 子密钥产生流程图

      3. 密码函数F(非线性的)

      (1). 函数F的操作步骤:密码函数F 的输入是32比特数据和48比特的子密钥:

      A.扩展置换(E):将数据的右半部分Ri从32位扩展为48位。位选择函数(也称E盒),如表5所示:

表 5

      B.异或:扩展后的48位输出E(Ri)与压缩后的48位密钥Ki作异或运算;

      C.S盒替代:将异或得到的48位结果分成八个6位的块,每一块通过对应的一个S盒产生一个4位的输出。

      S盒的具体置换过程(行和列均从0开始计数):某个Si盒的6位输入的第1位和第6位形成一个2位的二进制数,对应表中的某一行;输入的中间4位构成4位二进制数对应表中的某一列;第8个S盒的输入为001011,对应第8个S盒的第1行第5列(数为6),就用6(0110)代替原输入001011.

      下面给出选择函数Si(i=1,2,…….,8)的功能表:

表 6  S1盒

表 7 S2盒

      在此以S1为例说明其功能,在S1中,共有4行数据,命名为0,1,2,3行;每行有16列,命名为0,1,2,3,….,14,15列。现设输入为:D=D1D2D3D4D5D6,令:列=D2D3D4D5,行=D1D6;然后在S1表中查的对应的数,以4位二进制表示,此即为选择函数S1的输出。

      (2)、D、P盒置换:将八个S盒的输出连在一起生成一个32位的输出,输出结果再通过置换P产生一个32位的输出即:F(Ri,Ki),F(Ri,Ki)算法描述如图3,最后,将P盒置换的结果与最初的64位分组的左半部分异或,然后,左、右半部分交换,开始下一轮计算。

图 3 F(Ri, Ki)计算

      4. 密文输出:经过16次迭代运算后,得到L16、R16,将此作为输入,进行逆置换,即得到密文输出。逆置换正好是初始置的逆运算。例如,第1位经过初始置换后,处于第40位,而通过逆置换,又将第40位换回到第1位,其逆置换规则如表8所示:

表 8 逆置换规则

      图4为DES算法加密原理图:

图 4 DES算法加密原理图

      DES算法加密和解密过程采用相同的算法,并采用相同的加密密钥和解密密钥,两者的区别是:(1)、DES加密是从L0、R0到L15、R15进行变换,而解密时是从L15、R15到L0、R0进行变换的;(2)、加密时各轮的加密密钥为K0K1…K15,而解密时各轮的解密密钥为K15K14…K0;(3)、加密时密钥循环左移,解密时密钥循环右移。

      DES加密过程分析:

      (1)、首先要生成64位密钥,这64位的密钥经过“子密钥算法”换转后,将得到总共16个子密钥。将这些子密钥标识为Kn(n=1,2,…,16)。这些子密钥主要用于总共十六次的加密迭代过程中的加密工具。

      (2)、其次要将明文信息按64位数据格式为一组,对所有明文信息进行分组处理。每一段的64位明文都要经过初试置换IP,置换的目的是将数据信息全部打乱重排。然后将打乱的数据分为左右两块,左边一块共32位为一组,标识为L0;右边一块也是32位为一组,标识为R0.

      (3)、置换后的数据块总共要进行总共十六次的加密迭代过程。加密迭代主要由加密函数f来实现。首先使用子密钥K1对右边32位的R0进行加密处理,得到的结果也是32位的;然后再将这个32位的结果数据与左边32位的L0进行模2处理,从而再次得到一个32位的数据组。我们将最终得到的这个32位组数据,作为第二次加密迭代的R1,往后的每一次迭代过程都与上述过程相同。

      (4)、在结束了最后一轮加密迭代之后,会产生一个64位的数据信息组,然后我们将这个64位数据信息组按原有的数据排列顺序平均分为左右两等分,然后将左右两等分的部分进行位置调换,即原来左等分的数据整体位移至右侧,而原来右等分的数据则整体位移至左侧,这样经过合并后的数据将再次经过逆初始置换IP^-1的计算,我们最终将得到一组64位的密文。

      DES解密过程分析:DES的解密过程与它的加密过程是一样的,这是由于DES算法本身属于对称密码体制算法,其加密和解密的过程可以共用同一个过程和运算。

      DES加密函数f:在DES算法中,要将64位的明文顺利加密输出成64位的密文,而完成这项任务的核心部分就是加密函数f。加密函数f的主要作用是在第m次的加密迭代中使用子密钥Km对Km-1进行加密操作。加密函数f在加密过程中总共需要运行16轮。

      十六轮迭代算法:它先将经过置换后的明文分成两组,每组32位;同时密钥也被分成了两组,每组28位,两组密钥经过运算,再联合成一个48位的密钥,参与到明文加密的运算当中。S盒子,它由8个4*16的矩阵构成,每一行放着0到15的数据,顺序各个不同,是由IBM公司设计好的。经过异或运算的明文,是一个48位的数据,在送入到S盒子的时候,被分成了8份,每份6位,每一份经过一个S盒子,经过运算后输出为4位,即是一个0到15的数字的二进制表示形式。具体运算过程为,将输入的6位中的第1位为第6位合并成一个二进制数,表示行号,其余4位也合并成一个二进制数,表示列号。在当前S盒子中,以这个行号和列号为准,取出相应的数,并以二进制的形式表示,输出,即得到4位的输出,8个S盒子共计32位。

      DES算法优缺点:

      (1)、产生密钥简单,但密钥必须高度保密,因而难以做到一次一密;

      (2)、DES的安全性依赖于密钥的保密。攻击破解DES算法的一个主要方法是通过密钥搜索,使用运算速度非常高的计算机通过排列组合枚举的方式不断尝试各种可能的密钥,直到破解为止。一般,DES算法使用56位长的密钥,通过简单计算可知所有可能的密钥数量最多是2^56个。随着巨型计算机运算速度的不断提高,DES算法的安全性也将随之下降,然而在一般的民用商业场合,DES的安全性仍是足够可信赖的。

      (3)、DES算法加密解密速度比较快,密钥比较短,加密效率很高但通信双方都要保持密钥的秘密性,为了安全还需要经常更换DES密钥。

      openssl, include/des.h(des_old.h)文件中函数说明:

      1. DES_random_key:generates a random key. The PRNG must be seeded prior to using this function(see L<rand(3)|rand(3)>).  If thePRNG could not generate a secure key, 0 is returned.

      2.DES_set_key_checked: Before a DES key can beused, it must be converted into the architecture dependentI<DES_key_schedule> via the DES_set_key_checked() orDES_set_key_unchecked() function. DES_set_key_checked() will check that the keypassed is of odd parity and is not a week or semi-weak key.  If the parity is wrong, then -1 isreturned.  If the key is a weak key, then-2 is returned.  If an error is returned,the key schedule is not generated.

      3. DES_set_key:works like DES_set_key_checked() if the I<DES_check_key> flag isnon-zero, otherwise like DES_set_key_unchecked().

      4. DES_set_odd_parity:sets the parity of the passed I<key> to odd.

      5. DES_is_weak_key:returns 1 is the passed key is a weak key, 0 if it is ok.

      6. DES_ecb_encrypt:the basic DES encryption routine that encrypts or decrypts a single 8-byteI<DES_cblock> in I<electronic code book> (ECB) mode.

      7. DES_ecb3_encrypt:encrypts/decrypts the I<input> block by using three-key Triple-DESencryption in ECB mode. This involves encrypting the input with I<ks1>,decrypting with the key schedule I<ks2>, and then encrypting withI<ks3>.  This routine greatlyreduces the chances of brute force breaking of DES and has the advantage of ifI<ks1>, I<ks2> and I<ks3> are the same, it is equivalent tojust encryption using ECB mode and I<ks1> as the key.

      8. DES_ecb2_encrypt:The macro is provided to perform two-key Triple-DES encryption by usingI<ks1> for the final encryption.

      9. DES_ncbc_encrypt:encrypts/decrypts using the I<cipher-block-chaining> (CBC) mode of DES. If theI<encrypt> argument is non-zero, the routine cipher-block-chain encryptsthe cleartext data pointed to by the I<input> argument into theciphertext pointed to by the I<output> argument, using the key scheduleprovided by the I<schedule> argument, and initialization vector providedby the I<ivec> argument.  If the I<length>argument is not an integral multiple of eight bytes, the last block is copiedto a temporary area and zero filled.  Theoutput is always an integral multiple of eight bytes.

      10. DES_xcbc_encrypt:is RSA's DESX(DESX是DES的一个改进版本,原理是利用一个随机的二进制数与加密前的数据以及解密后的数据异或) mode of DES. It usesI<inw> and I<outw> to 'whiten' the encryption.  I<inw> and I<outw> are secret (unlikethe iv) and are as such, part of the key. So the key is sort of 24 bytes. This is much better than CBC DES.

      11. DES_ede3_cbc_encrypt:implements outer triple CBC DES encryption with three keys. This mode is usedby SSL.

      12. DES_ede2_cbc_encrypt:The macro implements two-key Triple-DES by reusing I<ks1> for the finalencryption. This form of Triple-DES is used by the RSAREF library.

      13. DES_pcbc_encrypt:encrypt/decrypts using the propagating cipher block chaining mode used byKerberos v4. Its parameters are the same as DES_ncbc_encrypt.

      14. DES_cfb_encrypt:encrypt/decrypts using cipher feedback mode. This method takes an array of characters as input and outputs and arrayof characters.  It does not require anypadding to 8 character groups. Note: the I<ivec> variable is changed andthe new changed value needs to be passed to the next call to this function.  Since this function runs a complete DES ECBencryption per I<numbits>, this function is only suggested for use whensending small numbers of characters.

      15. DES_cfb64_encrypt:implements CFB mode of DES with 64bit feedback. this routine will allow you toencrypt an arbitrary number of bytes, no 8 byte padding.  Each call to this routine will encrypt theinput bytes to output and then update ivec and num.

      16. DES_ede3_cfb64_encrypt:is the same as DES_cfb64_encrypt except that Triple-DES is used.

      17. DES_ede2_cfb64_encrypt:is the same as DES_cfb64_encrypt except that Triple-DES is used.

      18. DES_ofb_encrypt: encrypts using output feedbackmode.  This method takes an array ofcharacters as input and outputs and array of characters.  It does not require any padding to 8character groups. Note: the I<ivec> variable is changed and the newchanged value needs to be passed to the next call to this function.  Since this function runs a complete DES ECBencryption per numbits, this function is only suggested for use when sendingsmall numbers of characters.

      19. DES_ofb64_encrypt:is the same as DES_cfb64_encrypt using Output Feed Back mode.

      20. DES_ede3_ofb64_encrypt:is the same as DES_ofb64_encrypt, using Triple-DES.

      21. DES_ede2_ofb64_encrypt:is the same as DES_ofb64_encrypt, using Triple-DES.

      22. DES_cbc_cksum:produces an 8 byte checksum based on the input stream (via CBCencryption).  The last 4 bytes of thechecksum are returned and the complete 8 bytes are placed in I<output>.This function is used by Kerberos(网络认证协议) v4.

      23. DES_quad_cksum:is a Kerberos v4 function.  It returns a4 byte checksum from the input bytes. The algorithm can be iterated over the input, depending onI<out_count>, 1, 2, 3 or 4 times. If I<output> is non-NULL, the 8 bytes generated by each pass arewritten into I<output>.

      24. DES_fcrypt:is a fast version of the Unix crypt(3) function.  This version takes only a small amount ofspace relative to other fast crypt() implementations.  This is different to the normal crypt in thatthe third parameter is the buffer that the return value is written into.  It needs to be at least 14 bytes long.  This function is thread safe, unlike thenormal crypt.

      25. DES_crypt:is a faster replacement for the normal system crypt(). This function callsDES_fcrypt() with a static array passed as the third parameter.  This emulates the normal non-thread safesemantics of crypt(3).

      26. DES_enc_write:writes I<len> bytes to file descriptor I<fd> from bufferI<buf>. The data is encrypted via I<pcbc_encrypt> (default) usingI<sched> for the key and I<iv> as a starting vector.  The actual data send down I<fd>consists of 4 bytes (in network byte order) containing the length of thefollowing encrypted data.  The encrypted datathen follows, padded with random data out to a multiple of 8 bytes.

      27. DES_enc_read:is used to read I<len> bytes from file descriptor I<fd> into bufferI<buf>. The data being read from I<fd> is assumed to have come fromDES_enc_write() and is decrypted using I<sched> for the key schedule andI<iv> for the initial vector.

      Note: (1).ECB mode is not suitable for mostapplications; (2). DES_3cbc_encrypt is flawed and must not beused in applications. (3).DES_cbc_encrypt does not modify B<ivec>; useDES_ncbc_encrypt instead. (4). In OpenSSL 0.9.7, all des_ functions wererenamed to DES_ to avoid clashes with older versions of libdes.

      Des modes: the variants of DES and othercrypto algorithms of OpenSSL.

      Several crypto algorithms for OpenSSL can beused in a number of modes.  Those areused for using block ciphers in a way similar to stream ciphers, among otherthings.

      1、 ElectronicCodebook Mode (ECB): (1). Normally, this is found as the functionI<algorithm>_ecb_encrypt();(2). 64 bits are enciphered at a time;(3). The order of the blocks can be rearranged without detection; (4). The sameplaintext block always produces the same ciphertext block(for the same key)making it vulnerable to a 'dictionary attack'; (5). An error will only affect oneciphertext block.

      2、 CipherBlock Chaining Mode (CBC): (1). Normally, this is found as the functionI<algorithm>_cbc_encrypt(). Be aware that des_cbc_encrypt() is not reallyDES CBC (it does not update the IV); use des_ncbc_encrypt() instead; (2). amultiple of 64 bits are enciphered at a time; (3). The CBC mode produces the sameciphertext whenever the same plaintext is encrypted using the same key andstarting variable; (3). The chaining operation makes the ciphertextblocks dependent on the current and all preceding plaintext blocks andtherefore blocks can not be rearranged; (4). The use of different startingvariables prevents the same plaintext enciphering to the same ciphertext; (5). An errorwill affect the current and the following ciphertext blocks.

      3、 CipherFeedback Mode (CFB): (1). Normally, this is found as the functionI<algorithm>_cfb_encrypt(); (2). a number of bits (j) <= 64 areenciphered at a time; (3). The CFB mode produces the same ciphertextwhenever the same plaintext is encrypted using the same key and startingvariable; (4). The chaining operation makes the ciphertextvariables dependent on the current and all preceding variables and thereforej-bit variables are chained together and can not be rearranged; (5). The useof different starting variables prevents the same plaintext enciphering to thesame ciphertext; (6). The strength of the CFB mode depends on thesize of k (maximal if j == k).  In myimplementation this is always the case; (7). Selection of a small value for jwill require more cycles through the encipherment algorithm per unit ofplaintext and thus cause greater processing overheads; (8). Onlymultiples of j bits can be enciphered; (9). An error will affect the currentand the following ciphertext variables.

      4、 OutputFeedback Mode (OFB): (1). Normally, this is found as the functionI<algorithm>_ofb_encrypt(); (2). a number of bits (j) <= 64 areenciphered at a time; (3). The OFB mode produces the same ciphertextwhenever the same plaintext enciphered using the same key and startingvariable.  Moreover, in the OFB mode thesame key stream is produced when the same key and start variable are used.  Consequently, for security reasons a specificstart variable should be used only once for a given key; (4). Theabsence of chaining makes the OFB more vulnerable to specific attacks; (5). The useof different start variables values prevents the same plaintext enciphering tothe same ciphertext, by producing different key streams; (6). Selectionof a small value for j will require more cycles through the enciphermentalgorithm per unit of plaintext and thus cause greater processing overheads;(7). Only multiples of j bits can be enciphered; (8). OFB modeof operation does not extend ciphertext errors in the resultant plaintextoutput.  Every bit error in theciphertext causes only one bit to be in error in the deciphered plaintext; (9). OFB modeis not self-synchronizing.  If the twooperation of encipherment and decipherment get out of synchronism, the systemneeds to be re-initialized; (10). Each re-initialization should usea value of the start variable different from the start variable values usedbefore with the same key.  The reason forthis is that an identical bit stream would be produced each time from the sameparameters.  This would be susceptible toa 'known plaintext' attack.

      5、 TripleECB Mode: (1). Normally, this is found as the functionI<algorithm>_ecb3_encrypt(); (2). Encrypt with key1, decrypt withkey2 and encrypt with key3 again; (2). As for ECB encryption butincreases the key length to 168 bits. There are theoretic attacks that can beused that make the effective key length 112 bits, but this attack also requires2^56 blocks of memory, not very likely, even for the NSA; (3). If bothkeys are the same it is equivalent to encrypting once with just one key; (4). If thefirst and last key are the same, the key length is 112 bits. There are attacksthat could reduce the effective key strength to only slightly more than 56bits, but these require a lot of memory; (5). If all 3 keys are the same, thisis effectively the same as normal ecb mode.

      6、 TripleCBC Mode: (1). Normally, this is found as the functionI<algorithm>_ede3_cbc_encrypt(); (2). Encrypt with key1, decrypt withkey2 and then encrypt with key3; (3). As for CBC encryption butincreases the key length to 168 bits with the same restrictions as for tripleecb mode.

      参考文献:

      1、 《基于DES和ECC混合加密算法的数字签名研究与应用》

      2、 openssl/doc

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

对称加密算法之DES介绍 的相关文章

  • 第29章 电容触摸屏—触摸画板

    本章参考资料 xff1a STM32F76xxx参考手册 STM32F7xx 规格书 库帮助文档 STM32F779xx User Manual chm 关于开发板配套的触摸屏参数可查阅 5 0寸触摸屏面板说明 xff0c 触摸面板配套的触
  • SBUS2 协议初探

    SBUS2和SBUS的区别 1 xff1a 总线类型不一样 sbus是单向传输 xff0c 只做控制使用 xff0c 不做输入 SBUS2是非标准的双向总线 xff0c 可以做控制输出 xff0c 也可以做信息输入 2 xff1a 结束符不
  • IAR 中如何调用EmEditor

    IAR 中如何调用EmEditor 文本编辑器我一直都用EmEditor Emeditor是一款很优秀的纯文本编辑器 xff0c 它对中日韩等亚洲字符集支持的很好 xff0c 不仅有语法高亮显示功能 xff0c 搜索替换功能也是近乎可爱的强
  • 花了一下午,弄明白四个名词 USCI,USI,LIN,IrDa

    最近在看MSP的程序 xff0c TI的官方例子程序 xff0c 有些名词看了却不知道什么意思 xff0c 本着穷根问底的态度 xff0c 上网搜索 xff0c 花了一下午 xff0c 弄明白四个名词 USCI xff0c USI xff0
  • Cadence 17.2学习笔记--显示元件丝印及元件标号的设置

    快捷键Ctrl 43 F5 调出Color Dialog 左侧菜单第三项Geometry选项 钩选图中Silkscreen Top或Silkscreen Bottom可打开或关闭元件外形丝印的显示 同样Color Dialog对话框 左侧菜
  • 【Android UI】色板

    Hex CodeColor FFFFFF FFFFCC FFFF99 FFFF66 FFFF33 FFFF00 FFCCFF FFCCCC FFCC99 FFCC66 FFCC33 FFCC00 FF99FF FF99CC FF9999 F
  • 对称加密算法AES简介及在OpenSSL中使用举例

    高级加密标准 AES Advanced Encryption Standard 由美国国家标准和技术协会 NIST 于2000年公布 xff0c 它是一种对称加密算法 xff0c 用来替代DES AES也称为Rijndael算法 xff0c
  • 基于Hash的消息认证码HMAC简介及在OpenSSL中使用举例

    HMAC Hash based Message Authentication Code xff1a 基于Hash的消息认证码 xff0c 是一种通过特别计算方式之后产生的消息认证码 MAC xff0c 使用密码散列函数 xff0c 同时结合
  • 在Windows和Linux上编译gRPC源码操作步骤(C++)

    gRPC最新发布版本为v1 23 0 xff0c 下面以此版本为例说明在Windows和Linux下编译过程 Windows7 10 vs2103编译gRPC源码操作步骤 xff1a 1 需要本机已安装Git CMake Perl Go y
  • gRPC简介及简单使用(C++)

    gRPC是一个现代的 开源的 高性能远程过程调用 RPC 框架 xff0c 可以在任何平台运行 gRPC使客户端和服务器端应用程序能够透明地进行通信 xff0c 并简化了连接系统的构建 gRPC支持的语言包括C 43 43 Ruby Pyt
  • C语言中select函数简介及使用

    select函数用来检查套接字描述符 sockets descriptors 是否已准备好读 写 xff0c 提供了一种同时检查多个套接字的方法 Linux中select函数的声明在 usr include x86 64 linux gnu
  • VS Code离线安装C/C++插件cpptools-linux-aarch64.vsix

    一 问题 最近VS Code连接jetson nano xff0c 经常提示加载C C 43 43 插件失败 二 解决方法 根据提示 xff0c 在githup上 https github com microsoft vscode cppt
  • 开源库BearSSL介绍及使用

    BearSSL是用C语言实现的SSL TLS协议 xff0c 它的源码可直接通过git clone https www bearssl org git BearSSL 下载 xff0c 它的license是MIT xff0c 最新版本为0
  • 对称加密算法AES之GCM模式简介及在OpenSSL中使用举例

    AES Advanced Encryption Standard 即高级加密标准 xff0c 由美国国家标准和技术协会 NIST 于2000年公布 xff0c 它是一种对称加密算法 关于AES的更多介绍可以参考 xff1a https bl
  • ASN.1简介及OpenSSL中ASN.1接口使用举例

    ASN 1 Abstract Syntax Notation One 是一套标准 xff0c 是描述数据的表示 编码传输 解码的灵活的记法 它提供了一套正式 无歧义和精确的规则以描述独立于特定计算机硬件的对象结构 OpenSSL的编码方法就
  • 从openssl rsa pem文件中提取公私钥数据实现

    RSA为非对称加密算法 xff0c 关于其介绍可以参考 xff1a https blog csdn net fengbingchun article details 43638013 OpenSSL最新版为 1 1 1g xff0c 在Wi
  • 通过OpenSSL的接口实现Base64编解码

    对openssl genrsa产生的rsa私钥pem文件 xff0c 使用普通的base64解码会有问题 xff0c 如使用https blog csdn net fengbingchun article details 85218653
  • JWT(JSON Web Token)简介及实现

    JWT JSON Web Token xff1a 是一个开放标准 RFC 7519 xff0c 它定义了一种紧凑且自包含的方式 xff0c 用于在各方之间作为Json对象安全地传输信息 由于此信息是经过数字签名的 xff0c 因此可以被验证
  • SSL/TLS单向认证和双向认证介绍

    为了便于理解SSL TLS的单向认证和双向认证执行流程 xff0c 这里先介绍一些术语 1 散列函数 Hash function xff1a 又称散列算法 哈希函数 xff0c 是一种从任何一种数据中创建小的数字 指纹 的方法 散列函数把消
  • 使用OpenSSL生成自签名证书相关命令

    在用于小范围测试等目的的时候 xff0c 用户也可以自己生成数字证书 xff0c 但没有任何可信赖的机构签名 xff0c 此类数字证书称为自签名证书 证书一般采用X 509标准格式 下面通过OpenSSL相关命令介绍如何生成自签证书 1 生

随机推荐

  • Windows/Linux TCP Socket网络编程简介及测试代码

    典型的网络应用是由一对程序 即客户程序和服务器程序 组成的 xff0c 它们位于两个不同的端系统中 当运行这两个程序时 xff0c 创建了一个客户进程和一个服务器进程 xff0c 同时它们通过从套接字 socket 读出和写入数据在彼此之间
  • 基于BearSSL实现自签名证书双向认证测试代码

    客户端 服务器端双向认证大致过程 xff1a 可以参考 xff1a https blog csdn net fengbingchun article details 106856332 1 客户端发起连接请求 xff1b 2 服务器端返回消
  • C:\KEIL\C51\intrins.h包含不正确的路径。Keil 头文件路径错误

    步骤1 xff1a 先检查工程中的 include intrins h include stdio h xff0c 各文件之间 是否正确调用 步骤2 xff1a 将 include lt intrins h gt lt reg52 h gt
  • 分享一个Centos8的国内yum源

    使用的是阿里巴巴开源镜像站 xff0c 文件地址 xff1a https span class token punctuation span span class token operator span span class token o
  • 网络数据包分析软件Wireshark简介

    Wireshark是被广泛使用的免费开源的网络协议分析软件 network protocol analyzer 或网络数据包分析软件 xff0c 它可以让你在微观层面上查看网络上发生的事情 xff0c 它的功能是截取网络数据包 xff0c
  • HTTP请求方法介绍

    之前在https blog csdn net fengbingchun article details 85039308 中介绍过HTTP协议 xff0c 在https blog csdn net fengbingchun article
  • TCP Flags标志位介绍

    传输控制协议 Transmission Control Protocol xff0c TCP 是一种传输层协议 TCP使数据包从源到目的地的传输更加顺畅 它是一种面向连接的端到端协议 每个数据包由TCP包裹在一个报头中 xff0c 该报头由
  • 代理服务器简介及libcurl测试

    代理服务器英文全称是Proxy Server xff0c 其功能就是将局域网用户连接到Internet xff0c 代理网络用户去获得网络信息 形象地说 xff0c 它是网络信息的中转站 xff0c 是连接内部局域网和Internet的一种
  • CMake中find_package的使用

    CMake中的命令find package用于查找指定的package find package支持两种主要的搜索方法 xff1a 注意 xff1a lt PackageName gt 是区分大小写的 1 Config mode 配置模式
  • CMake中link_directories/target_link_directories的使用

    CMake中的link directories命令用于添加目录使链接器能在其查找库 add directories in which the linker will look for libraries xff0c 其格式如下 xff1a
  • UDP协议在Windows上使用示例

    UDP User Datagram Protocol xff0c 用户数据报协议 是无连接的 xff0c 因此在两个进程通信前没有握手过程 UDP协议提供一种不可靠数据传送服务 xff0c 也就是说 xff0c 当进程将一个报文发送进UDP
  • 代码覆盖率工具OpenCppCoverage在Windows上的使用

    OpenCppCoverage是用在Windows C 43 43 上的开源的代码覆盖率工具 xff0c 源码地址为https github com OpenCppCoverage OpenCppCoverage xff0c 最新发布版本为
  • nerfstudio介绍及在windows上的配置、使用

    nerfstudio提供了一个简单的API xff0c 可以简化创建 训练和可视化NeRF的端到端过程 该库通过模块化每个组件来支持可解释的NeRF实现 nerfstudio源码地址 https github com nerfstudio
  • Qt中QDebug的使用

    QDebug类为调试信息 debugging information 提供输出流 它的声明在 lt QDebug gt 中 xff0c 实现在Core模块中 将调试或跟踪信息 debugging or tracing information
  • OkHttpUtil

    package com example someutil util import com google gson Gson import java util Iterator import java util Map import java
  • Sourcetree介绍及使用

    Sourcetree是一个操作简单但功能强大的免费Git客户端管理工具 xff0c 可应用在Windows和Mac平台 Sourcetree的安装 xff1a 1 从Sourcetree Free Git GUI for Mac and W
  • C++14中lambda表达式新增加的features的使用

    lambda表达式是在C 43 43 11中引入的 xff0c 它们可以嵌套在其它函数甚至函数调用语句中 xff0c C 43 43 11中lambda表达式的使用参考 xff1a https blog csdn net fengbingc
  • OpenSSL简介及在Windows、Linux、Mac系统上的编译步骤

    OpenSSL介绍 xff1a OpenSSL是一个强大的安全套接字层密码库 xff0c 囊括主要的密码算法 常用的密钥和证书封装管理功能及SSL协议 xff0c 并提供丰富的应用程序供测试或其它目的使用 SSL是SecureSockets
  • 信息安全领域相关术语介绍

    一 SSL 安全套接字层 SSL Secure Sockets Layer 是一种协议 xff0c 支持服务通过网络进行通信而不损害安全性 它在客户端和服务器之间创建一个安全连接 然后通过该连接安全地发送任意数据量 SSL最初是用来保障数据
  • 对称加密算法之DES介绍

    DES Data Encryption Standard 是分组对称密码算法 DES采用了64位的分组长度和56位的密钥长度 xff0c 它将64位的输入经过一系列变换得到64位的输出 解密则使用了相同的步骤和相同的密钥 DES的密钥长度为