When using API nlapiEncrypt(s),it automatically returns a string value using SHA-1 method.
Note: SHA-1 - The Secure Hash Algorithm isthe original 160-bit hash function. Resembling the earlier MD5 algorithm, thiswas designed by the National Security Agency (NSA) to be part of the DigitalSignature Algorithm.
However, this function has an overload method that will allow usersto pass different types of encryption method:
nlapiEncrypt(s, type)
Set the value of type toany of the following:
base64 - a group of similar encodingschemes that represent binary data in an ASCII string format by translating itinto a radix-64 representation. The Base64 term originates from a specific MIMEcontent transfer encoding.
aes - Advanced EncryptionStandard (AES) is a symmetric-key encryption standard adopted by theU.S. government. The standard comprises three block ciphers, AES-128, AES-192and AES-256, adopted from a larger collection originally published as Rijndael.Each of these ciphers has a 128-bit block size, with key sizes of 128, 192 and256 bits, respectively. The AES ciphers have been analyzed extensively and arenow used worldwide, as was the case with its predecessor,[3] the DataEncryption Standard (DES).
xor - a simple encryption algorithm thatoperates according to the principles of XOR operator
Here are some varied sample implementations:
nlapiEncrypt("Eliseo", "base64");
- Result: "RWxpc2Vv"
nlapiEncrypt("Eliseo", "aes");
- Result: "c9697c33cc5cd6db32d1c3555e509d75"
nlapiEncrypt("Eliseo", "xor");
- Result: "755b37574631"
Your blog is awfully appealing. I am contented with your post. I regularly read your blog and its very helpful. If you are looking for the best Algorithm Interview Questions, then visit TutorialCup. Thanks! I enjoyed this blog post.
ReplyDelete