UNPKG

rhash

Version:

rHash | Data Encryption | by Swôth#9990

114 lines (103 loc) 3.21 kB
## rHash® | Data Encryption --- --- --- > **Copyright © 2020 | Apache 2.0** --- > **Developer / Geliştirici:** `Swôth#9990` --- --- --- #### Usage / Kullanım --- --- --- ``` EN: First we have to define the package. TR: İlk olarak modülü tanımlamalıyız. ``` ```js const rHash = require('rhash') ``` --- ``` EN: Let's encrypt a text. TR: Bir metni şifreleyelim. ``` ```js const rHash = require('rhash') //You can write whatever you want here. //Buraya istediğinizi yazabilirsiniz. const text = "Hello world!" //If you want to use our ready-made encryption method, type rHash.key("RHS-128") or type your own key. //Hazır şifreleme yöntemini kullanmak isterseniz rHash.key("RHS-128") yazın veya kendi istediğiniz bir key yazın. const key = rHash.key("RHS-128") //or const key = "mySuperSecretKey" const encryptedText = rHash.hash(text, key) console.log(encryptedText) // Console: 75585151521d4a524f51591c ``` --- ``` EN: Use of encryption in login system. TR: Şifrelemenin giriş sisteminde kullanımı. ``` ```js const rHash = require('rhash') const hashedPass = rHash.hash("normalPassword", "superSecretKey") const formInput = "test123" // invalid password if (rHash.hash(formInput, "superSecretKey") === hashedPass) { console.log("Logged in!") } else { console.log("Invalid Password!") } ``` --- ``` EN: Let's decrypt an encrypted code. TR: Şifreli bir kodun şifresini çözelim. ``` ```js const rHash = require('rhash') //You can write whatever you want here. //Buraya istediğinizi yazabilirsiniz. const text = "Hello world!" //If you want to use our ready-made encryption method, type rHash.key ("RHS-128") or type your own key. //Hazır şifreleme yöntemini kullanmak isterseniz Hash.key("RHS-128") yazın veya kendi istediğiniz bir key yazın. const key = rHash.key("RHS-128") //or const key = "mySuperSecretKey" const encryptedText = rHash.hash(text, key) // this is encrypted code / bu şifrelenmiş kod console.log(encryptedText) // Console: 75585151521d4a524f51591c //The key must be the same key used when encrypting! //Key şifrelerken kullanılan key ile aynı olmalıdır! const decryptedText = rHash.unhash(encryptedText, key) console.log(decryptedText) // Console: Hello world! ``` --- --- --- #### Rules / Kurallar --- --- --- ``` (EN) 1 - The key used for encryption and the key used for decryption must be the same. (TR) 1 - Şifrelenirken kullanılan anahtar ile çözerken kullanılan anahtar aynı olmalıdır. (EN) 2 - The text to be encrypted must not contain UTF-8 characters. (Except Turkish characters) (TR) 2 - Şifrelenecek metin UTF-8 karakterleri içermemelidir. (Türkçe karakterler hariç) (EN) 3 - Do not share the key you are using, otherwise they may decrypt it. (TR) 3 - Kullandığınız anahtarı sakın paylaşmayın aksi takdirde şifresini çözebilirler. (EN) 4 - The key length of ready encryption methods is more than 750. (TR) 4 - Hazır şifreleme yöntemlerinin anahtarının uzunluğu 750'den fazladır. ``` --- --- --- #### Updates / Güncellemeler --- --- --- > **0.0.2 ▸ The encryption system has been strengthened!** --- > **0.0.1 ▸ Package created and published on NPM** --- --- --- > **by `Swôth#9990` (Apache 2.0)**