Socket
Socket
Sign inDemoInstall

rhash

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rhash - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

src/swothReplacer.js

4

package.json

@@ -14,6 +14,6 @@ {

],
"license": "MIT",
"license": "Apache-2.0",
"main": "rHash.js",
"name": "rhash",
"version": "0.0.1"
"version": "0.0.2"
}

@@ -42,2 +42,19 @@ ## rHash® | Data Encryption

```
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.

@@ -92,2 +109,4 @@ TR: Şifreli bir kodun şifresini çözelim.

---
> **0.0.2 ▸ The encryption system has been strengthened!**
---
> **0.0.1 ▸ Package created and published on NPM**

@@ -94,0 +113,0 @@ ---

@@ -0,1 +1,2 @@

const swothReplacer = require('./src/swothReplacer.js');
const swothUnhash = require('./src/swothUnhash.js');

@@ -7,5 +8,7 @@ const swothHash = require('./src/swothHash.js');

static key(type) {
if (!type) throw new Error('\n\n> (EN) rHash Error: Please choose which ready-made encryption method to use!\n> (TR) rHash Hata: Lütfen hangi hazır şifreleme yöntemini kullanacağınızı seçiniz!\n\n> Ready Encryption Methods / Hazır Şifreleme Yöntemleri;\n -> RHS-128 (Available / Mevcut)\n -> RHS-256 (Coming with v0.0.2 / v0.0.2 ile geliyor)\n -> RHS-512 (Coming with v0.0.3 / v0.0.3 ile geliyor)\n');
return "rhash://ready-made/?type=" + type;
static key(length) {
if (!length) throw new Error('\n\n> (EN) rHash Error: Enter the length of the key to be created!\n> (TR) rHash Hata: Oluşturulacak anahtarın uzunluğunu yazınız!\n')
if (isNaN(length)) throw new Error('\n\n> (EN) rHash Error: Please write a valid number!\n> (TR) rHash Hata: Lütfen geçerli bir sayı yazınız!\n')
if (length < 20 || length > 1000) throw new Error('\n\n> (EN) rHash Error: For security reasons, the key length can be minimum 20 and maximum 1000!\n> (TR) rHash Hata: Güvenlik sebebi ile anahtar uzunluğu en az 20, en fazla 1000 olabilir!\n')
return swothGen(length);
}

@@ -16,16 +19,3 @@

if (!key) throw new Error('\n\n> (EN) rHash Error: Enter a key that will be needed later to decrypt the data!\n> (TR) rHash Hata: Bir anahtar giriniz bu anahtar daha sonra veriyi çözmek için lazım olacak!\n');
if (key.includes("rhash://ready-made/?type=")) {
const rmType = key.replace("rhash://ready-made/?type=", "");
const rmEncryption = require('./src/encryption.js');
const rmHasher = swothHash(rmEncryption(rmType).replace(/[^\x00-\x7F]/g,''));
const rmData = data
.split("ğ").join("|*g*|").split("Ğ").join("|*G*|").split("ç").join("|*c*|")
.split("Ç").join("|*C*|").split("ş").join("|*s*|").split("Ş").join("|*S*|")
.split("ü").join("|*u*|").split("Ü").join("|*U*|").split("ö").join("|*o*|")
.split("Ö").join("|*O*|").split("ı").join("|*i*|").split("İ").join("|*I*|");
const rmHashed = rmHasher(rmData);
return rmHashed;
}
const swothHasher = swothHash(key.replace(/[^\x00-\x7F]/g,''));

@@ -37,3 +27,8 @@ const swothData = data

.split("Ö").join("|*O*|").split("ı").join("|*i*|").split("İ").join("|*I*|");
const swothHashed = swothHasher(swothData);
const swothHashed = swothHasher(swothData).toUpperCase()
.split("1").join(swothReplacer("1")).split("2").join(swothReplacer("2"))
.split("3").join(swothReplacer("3")).split("4").join(swothReplacer("4"))
.split("5").join(swothReplacer("5")).split("6").join(swothReplacer("6"))
.split("7").join(swothReplacer("7")).split("8").join(swothReplacer("8"))
.split("9").join(swothReplacer("9")).split("0").join(swothReplacer("0"))
return swothHashed;

@@ -46,16 +41,10 @@ }

if (key.includes("rhash://ready-made/?type=")) {
const rmType = key.replace("rhash://ready-made/?type=", "");
const rmEncryption = require('./src/encryption.js')
const rmUnhasher = swothUnhash(rmEncryption(rmType).replace(/[^\x00-\x7F]/g,''));
const rmUnhashed = rmUnhasher(code)
.split("|*g*|").join("ğ").split("|*G*|").join("Ğ").split("|*c*|").join("ç")
.split("|*C*|").join("Ç").split("|*s*|").join("ş").split("|*S*|").join("Ş")
.split("|*u*|").join("ü").split("|*U*|").join("Ü").split("|*o*|").join("ö")
.split("|*O*|").join("Ö").split("|*i*|").join("ı").split("|*I*|").join("İ");
return rmUnhashed;
}
const swothCode = code.toLowerCase()
.split(swothReplacer("1")).join("1").split(swothReplacer("2")).join("2")
.split(swothReplacer("3")).join("3").split(swothReplacer("4")).join("4")
.split(swothReplacer("5")).join("5").split(swothReplacer("6")).join("6")
.split(swothReplacer("7")).join("7").split(swothReplacer("8")).join("8")
.split(swothReplacer("9")).join("9").split(swothReplacer("0")).join("0")
const swothUnhasher = swothUnhash(key.replace(/[^\x00-\x7F]/g,''));
const swothUnhashed = swothUnhasher(code)
const swothUnhashed = swothUnhasher(swothCode)
.split("|*g*|").join("ğ").split("|*G*|").join("Ğ").split("|*c*|").join("ç")

@@ -62,0 +51,0 @@ .split("|*C*|").join("Ç").split("|*s*|").join("ş").split("|*S*|").join("Ş")

@@ -7,3 +7,3 @@ //||===---===---===---===---===---===---===||\\

var _0x3eaa=['charAt','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+%&*!'];(function(_0x1e370b,_0x3eaacd){var _0x28d64c=function(_0x18d7cf){while(--_0x18d7cf){_0x1e370b['push'](_0x1e370b['shift']());}};_0x28d64c(++_0x3eaacd);}(_0x3eaa,0x1ee));var _0x28d6=function(_0x1e370b,_0x3eaacd){_0x1e370b=_0x1e370b-0x0;var _0x28d64c=_0x3eaa[_0x1e370b];return _0x28d64c;};var _0x592ad2=_0x28d6,swothSonuç='',swothKarakterler=_0x592ad2('0x1'),swothUzunluk=swothKarakterler['length'];for(var i=0x0;i<swothLength;i++){swothSonuç+=swothKarakterler[_0x592ad2('0x0')](Math['floor'](Math['random']()*swothUzunluk));}return swothSonuç;
var _0x3eaa=['charAt','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!^+%&/()=?_-*}][{}$#£<>:,.;~\@€'];(function(_0x1e370b,_0x3eaacd){var _0x28d64c=function(_0x18d7cf){while(--_0x18d7cf){_0x1e370b['push'](_0x1e370b['shift']());}};_0x28d64c(++_0x3eaacd);}(_0x3eaa,0x1ee));var _0x28d6=function(_0x1e370b,_0x3eaacd){_0x1e370b=_0x1e370b-0x0;var _0x28d64c=_0x3eaa[_0x1e370b];return _0x28d64c;};var _0x592ad2=_0x28d6,swothSonuç='',swothKarakterler=_0x592ad2('0x1'),swothUzunluk=swothKarakterler['length'];for(var i=0x0;i<swothLength;i++){swothSonuç+=swothKarakterler[_0x592ad2('0x0')](Math['floor'](Math['random']()*swothUzunluk));}return swothSonuç;

@@ -10,0 +10,0 @@ // Generate kodu şifrelenmiştir!

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc