Blowfish encryption is implemented using PHP and C ++, but the results are different... first, the MD5 experiment has the same results, but the Blowfish experiment cannot be successful. the following code is called: PHPcode lt ;? Php $ ciphermcrypt_module_open (MCRYPT_BLOWFISH, MCRYPT_MODE_ECB,); Blowfish
Blowfish encryption is implemented using PHP and C ++, but the results are different. First, the MD5 experiment has the same results, but the Blowfish experiment cannot be used.
The call is as follows:
% S", Strtoupper (bin2hex ($ dtext);} mcrypt_module_close ($ cipher );
C ++ is like this:
MD5_CTX md5; unsigned char str[16]; md5.MD5String(strSou
First MD5 experiment, the result is the same, but use Blowfish experiment, how to do also can not succeed
The call is as follows:
%s", Strtoupper (Bin2Hex ($dtext))); } Mcrypt_module_close ($cipher);
C + + is the case:
Md5_ctx MD5; unsigned char str[16]; MD5. Md5string (STRSOURCE.C_STR (), str); Blockcipher *BF; Char key[] = "Strkey11"; Key bf = new BlowFish ()
Blowfish encryption, respectively, using PHP and C + + implementation, but the results are different ...
First MD5 experiment, the result is the same, but use Blowfish experiment, how to do also can not succeed
The call is as follows:
PHP Code
%s", Strtoupper (Bin2Hex ($dtext))); } Mcrypt_module_close ($cipher);
C + + is the case:
Encounter a demand, pay password submitted to the server using Blowfish encryption, online data is very few, found the code is also with the results of online encryption, online encryption (to confirm the encryption results are incorrect):
PHP Blowfish algorithm encryption and decryption for your reference, the specific contents are as follows
Blowfish encryption algorithm in PHP use the second example
The above is the entire content of this article, I hope that you learn PHP program help.
1. BlowfishAlgorithmDescription (the data type in this document is based on tc2.0)
The blowfish algorithm is used to encrypt 64-bit strings.The blowfish algorithm uses two "Boxes": ungigned long pbox [18] and unsigned long sbox [4,256].In the blowfish algorithm, there is a core encryption function: bf_en (which will
This is a creation in
Article, where the information may have evolved or changed.
Recently due to the need for work, the implementation of a go Blowfish algorithm is required. In fact, go itself has a cryptographic algorithm library crypto, which has blowfish. But the algorithm differs from my needs in many details, resulting in a wide variety of final encryption
/*Des, tripledes and blowfish in Silverlight*/Namespace broccoliproducts{Using system;Using system. Collections. Generic;# If debugUsing system. diagnostics;# Endif // # If debugUsing system. LINQ;Using system. text;Using system. IO;Using system. Security. cryptography;/// /// Declaration of descrytography class/// Public static class descrytography{//////////////////////////////////////// /////////////////////// Nested classes/// /// Declaration of b
encoding format, not the encryption algorithm)MD5 (Message Digest algorithm 5, Information Digest algorithm)SHA (Secure Hash algorithm, security hashing algorithm)HMAC (Hash message authentication code, hash messages authentication code)CRC (cyclical redundancy check, cyclic redundant code check)Symmetric encryption algorithm: The encryption key is the same as t
algorithms: DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm, IDEA algorithm,AES Algorithm.
Asymmetric encryption algorithm:RSA, Elgamal, backpack algorithm, Rabin, D-H, ECC.
Typical hash algorithms: MD2, MD4,MD5And SHA-1 (the purpose is to convert any long input to a fixed long output by using an algorithm, and ensure that the input changes slightly and the output is differ
key.
Caesar's password is symmetric encryption, and his character offset is the secret key.
Common algorithms for symmetric encryption
AES, DES, 3DES, Tdea, Blowfish, RC2, RC4, RC5, Idea, skipjack and so on.
DES: All known as the data encryption Standard, the encryption
): Digital Signature Algorithm, which is a standard DSS (Digital Signature Standard );
AES (Advanced Encryption Standard): Advanced Encryption Standard, which is the next-generation Encryption algorithm Standard with fast speed and high security level. Currently, one of the implementations of the AES Standard is the Rijndael algorithm;
hash loop, much like the cost parameter of the Blowfish algorithm. The default number of cycles is 5000, the minimum is 1000, and the maximum is 999,999,999. N that exceeds this range will be converted to the nearest value.
The crypt_sha512-sha-512 algorithm uses a 16-character string salt value that begins with $6$ to hash. If the salt value string begins with "rounds=
$", the numeric value of N is used to specify the number of exec
1.Encryption Algorithm Daquan:Rsa:RSA is made of the initial letters of the surnames of Ron Rivest, Adi Shamir, and Leonard Adleman, who first publicly desc Ribed the algorithm in 1977.Http://www.emc.com/corporate/about-rsa/index.htmHttps://en.wikipedia.org/wiki/RSA_%28cryptosystem%29DSA: Digitally Signature algorithm digital Signature AlgorithmECDSA: Elliptic Curve digital Signature algorithm Elliptic curve Signature algorithmDSS: Digital Signature S
following is an asymmetric encryption algorithm for PHP extracted from the Internet using openssl.
Symmetric encryption algorithm
Symmetric encryption (also called private key encryption) refers to the encryption algorithm that uses the same key for
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.