According to dictionary definitions, cryptography is "a set of principles and techniques employed to encrypt the writing, make it unintelligible for those who do not have access to the combined conventions".
That is, any algorithm that makes the content unreadable or interpretable we can think, in a simple way, as encryption, or even simpler, any algorithm that "shuffles" the data.
Look at the example below, which I took from this site: http://www.henryalgus.com
var jsEncode = {
encode: function (s, k) {
var enc = "";
var str = "";
// make sure that input is string
str = s.toString();
for (var i = 0; i < s.length; i++) {
// create block
var a = s.charCodeAt(i);
// bitwise XOR (operação lógica que "mexe" nos bits, gerando o efeito de "embaralhar" o caractere)
var b = a ^ k;
enc = enc + String.fromCharCode(b);
}
return enc;
}
};
var chave = "123";
var e = jsEncode.encode("Teste de criptografia",chave);
console.log("dados criptografados: " + e);
var d = jsEncode.encode(e,chave);
console.log("dados descriptografados: " + d);
It’s a simple example that makes a simple encryption, a practical example close to everyday programming as you mentioned.
Hash is already a mathematical calculus, which generates a numerical representation of a given.
The main feature of the hash is that it is not reversed, or "decrypted" so to speak, unlike the above example, or other commonly used algorithms such as these:
Symmetric key encryption: The same key is used to encrypt and decrypt the data.
Among the algorithms that use this technique are DES (Data Encryption Standard), and RC (Ron’s Code or Rivest Cipher) (RC2, RC4, etc)
Encryption with asymmetric key, or public key.
He works with two keys: a private and a public key. The public key is used to encrypt, and when sending the data to someone (or somewhere), it must send it separately to a private key, so that the data can be decrypted.
Some examples are:
RSA (Rivest, Shamir and Adleman) and Elgamal
Other known algorithms, mainly in Wifi networks are WEB and WPA.
References: http://pcworld.com.br/
I believe that the question is a little broad for the format of Sopt, but of all sorts, my two cents: https://answall.com/q/43492/64969
– Jefferson Quesado
When I need to see something security/encryption, I usually dig up the answers from mgibsonbr on the subject: https://answall.com/search?q=user%3A215+%5Bsegura%C3%A7a%5D
– Jefferson Quesado
Some mathematical basis of a channel on YT that I really like: https://www.youtube.com/watch?v=12Q3Mrh03Gk ; https://www.youtube.com/watch?v=NOs34_-eREk ;
– Jefferson Quesado
Guys, you know if Base64 is an encryption algorithm?
– Mariana Bayonetta
No, Base64 is just an encoding standard. If you assume that Base64 encrypts data, then using Roman numbers is encrypting decimals.
– Jefferson Quesado
I get it, thank you.
– Mariana Bayonetta