/* des: duplicate the NBS Data Encryption Standard in software.
* usage: des <file>
* prompts for the password
* If the filename ends in ".n" it will be decrypted with the key;
* otherwise it will be encrypted.
*
* Permutation algorithm:
* The permutation is defined by its effect on each of the 16 nibbles
* of the 64-bit input. For each nibble we give an 8-byte bit array
* that has the bits in the input nibble distributed correctly. The
* complete permutation involves ORing the 16 sets of 8 bytes designated
* by the 16 input nibbles. Uses 16*16*8 = 2K bytes of storage for
* each 64-bit permutation. 32-bit permutations (P) and expansion (E)
* are done similarly, but using bytes instead of nibbles.
* Should be able to use long ints, adding the masks, at a
* later pass. Tradeoff: can speed 64-bit perms up at cost of slowing
* down expansion or contraction operations by using 8K tables here and
* decreasing the size of the other tables.
* The compressions are pre-computed in 12-bit chunks, combining 2 of the
* 6->4
本文关键字:程序 综合-其它,单片机-工控设备 - 综合-其它
上一篇:巧用C51的BANK编译模式