From: http://snowolf.iteye.com/blog/380034
Next, we will introduce symmetric encryption algorithms. The most common is des data encryption algorithms.Des Des-Data Encryption Standard, which is the data encryption algorithm. It was
Des encryption uses DESCryptoServiceProvider encryption. DESCryptoServiceProvider under the namespace: System.Security.Cryptography;The advantages of symmetric encryption algorithms are the high speed of decryption and the difficulty of cracking when using long keys. Assuming that two users need to encrypt and then exc
Reprint Please specify source: http://blog.csdn.net/zhaokaiqiang1992In the previous article, we discussed the DES algorithm, but also understand how to ensure the consistency of the encryption and decryption results under different platforms. But Des, as a kind of encryption algorithm that has appeared for a long time,
-bit data. If the number of data digits lacks a multiple of 64-bit, it must be filled with a multiple of 64-bit.
NoPadding
The API or algorithm itself does not process the data, and the encrypted data is managed by the encryption algorithm on both sides. For example, if you perform encryption and decryption on string data, you can add \ 0 or space and trim
PKCS5P
I have not found any good DES encryption code for a long time.
It is no wonder that a blogger said that he had not found himself for a long time. Http://www.iteye.com/topic/422575
But it seems that he said that the encrypted plaintext will go wrong, so I did not dare to try it out.
In addition, I downloaded one from Tiandi, and found that the function was still possible. It seems that I switched the js vers
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Using System; Using System. Data; Using System. configuration; Using System. LINQ; Using System. Web; Using System. Web. Security; Using System. Web. UI; Using System. Web. UI. htmlcontrols; Using System. Web. UI. webcontrols; Using System. Web. UI. webcontrols. webparts; Using System. xml. LINQ; Using System. text; Using System. IO; Using System. Security. cryptogra
[Android development experience] a safer algorithm than DES encryption-3DES encryption algorithm, android3des
Reprinted please indicate the source: http://blog.csdn.net/zhaokaiqiang1992
In the previous article, we discussed the DES algorithm and learned how to ensure the consistency of
Using system;
Using system. IO;
Using system. Windows. forms;
Using system. Collections. Generic;
Using system. text;
Using system. Security. cryptography;
Namespace mydes{/// /// DES encryption/decryption and MD5 Encryption/// Public class my_des{# Region private attributes
/// /// MD5 encrypted string/// Private string md5str = NULL;/// ///
Introduction to des algorithm Description:Des is the abbreviation for the data Encryption standard. It is a cryptographic algorithm developed by IBM, the United States National Standards Bureau published in 1977 to use it as a non-confidential department of Data encryption standards; It is a packet encryption algorithm
,
IvParameterSpec iv = new IvParameterSpec ("12345678". getBytes ());This mode features:
1. the ciphertext length encrypted each time is 64 bits (8 bytes );
2. When the same plaintext uses the same key and initial vector, the CBC mode always produces the same ciphertext;
3. ciphertext blocks depend on previous operation results. Therefore, ciphertext blocks cannot be rearranged;
4. Different Initialization vectors can be used to prevent the same ciphertext produced by the same plain text, so a
, pkcs7padding and pkcs5padding are actually just different protocols, According to the relevant information: Pkcs5padding clearly defined the encryption block is 8 bytes, pkcs7padding encryption can be fast between 1-255. But the encapsulated des algorithm is 8 bytes by default, so you can think of them the same. The data complement is actually a multiple of les
Clear text: Also known as the user can directly read the informationRedaction: Ciphertext is a collection of meaningless, messy codeEncryption: Encryption is a process of converting plaintext into redact under the control of certain algorithms and keys.Decryption: Enter a key under the control of a particular algorithm to convert ciphertext into plaintextEncryption Algorithm Decryption Algorithmplaintext ----------------- ciphertext ------------------
Comparison of Des and AESSince the DES algorithm has been revealed to the world, the academic circles have carried on the research and the intense controversy about its security and so on. Technically, the criticism of DES is mainly focused on the following aspects:1, as a block cipher, DES
. According to relevant information, PKCS5Padding clearly defines that the encryption block is 8 bytes, PKCS7Padding can be encrypted between 1 and. However, the encapsulated DES algorithms are 8 bytes by default, so they can be considered the same. The data population is actually the filling process of the multiples of 8 bytes when the data is smaller than the multiples of 8 bytes.
NoPadding filling mode:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service