Skip to content

there will be extra white space #1

@hoythan

Description

@hoythan
        var key = "test";
        var message = "admin";
        var ciphertext = des (key, message, true, 0,'', 1);
        


        btoa(ciphertext)  // mDSUHsRcgOY=
        des(key, ciphertext, false) // admin���
	// CryptoJS
	const keyHex = CryptoJS.enc.Utf8.parse('test')
	const decrypted = CryptoJS.DES.decrypt(
		{
			iv: '',
			salt: '',
			ciphertext: CryptoJS.enc.Base64.parse(btoa(ciphertext))
		}, 
		keyHex,
		{
			mode: CryptoJS.mode.ECB,
			padding: CryptoJS.pad.Pkcs7
		}
	)
	decrypted.toString(CryptoJS.enc.Utf8) // admin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions