You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Encrypt message by DES in ECB mode and Pkcs7 padding scheme
*
* NOTE: DES is weak, please use 3DES(Triple DES) or AES
*
* @param {String} message
* @param {String} key
* @return {String} ciphertext(base64 string)
*
* @author Sun
* @version 2013-5-15
*
* @see <a href="https://groups.google.com/d/msg/crypto-js/I378fq3esK8/HZ2P2Xtuzk8J">des encrypion: js encrypted value does not match the java encrypted value</a>
* In cryptoJS you have to convert the key to hex
* and useit as word just like above (otherwise it will be considered as passphrase)
*
* @see <a href="http://stackoverflow.com/questions/12894722/c-sharp-and-java-des-encryption-value-are-not-identical">C# and Java DES Encryption value are not identical</a>
* SunJCE provider uses ECB as the default mode,
* and PKCS5Padding as the default padding scheme for DES.(JCA Doc)
* This means that in the case of the SunJCE provider,