BetterKeySystem
Key Required VerifiedUniversal

BetterKeySystem

Universal Scriptvxstyvxsty 238.4K views 275 executesUpdated May 23, 2024
1.0/ 5(24 votes)
51921% Positive
Lua Script•182 lines (5316 chars)
-- Below is a simple hashing system to prevent your key system from being easily bypassed.
-- Join https://discord.gg/gYhqMRBeZV
local rawKey = '1234'
local updatedKey;
local _LOCALCRYPT = {}
local bit = table.clone(bit32)

-- Caesar Cipher.
function _LOCALCRYPT.encrypt(plaintext, shift)
    local encryptedText = ""
    if type(shift)=='string' then shift = #shift end
    for i = 1, #plaintext do
        local char = plaintext:sub(i, i)
        if char >= 'A' and char <= 'Z' then
            local encryptedChar = string.char((string.byte(char) - string.byte('A') + shift) % 26 + string.byte('A'))
            encryptedText = encryptedText .. encryptedChar
        elseif char >= 'a' and char <= 'z' then
            local encryptedChar = string.char((string.byte(char) - string.byte('a') + shift) % 26 + string.byte('a'))
            encryptedText = encryptedText .. encryptedChar
        else
            encryptedText = encryptedText .. char
        end
    end
    return encryptedText
end
_LOCALCRYPT.decrypt = _LOCALCRYPT.encrypt

local function str2hexa(a)
    return string.gsub(
        a,
        ".",
        function(b)
            return string.format("%02x", string.byte(b))
        end
    )
end
local function num2s(c, d)
    local a = ""
    for e = 1, d do
        local f = c % 256
        a = string.char(f) .. a
        c = (c - f) / 256
    end
    return a
end
local function s232num(a, e)
    local d = 0
    for g = e, e + 3 do
        d = d * 256 + string.byte(a, g)
    end
    return d
end
local function preproc(h, i)
    local j = 64 - (i + 9) % 64
    i = num2s(8 * i, 8)
    h = h .. "\128" .. string.rep("\0", j) .. i
    assert(#h % 64 == 0)
    return h
end
local function k(h, e, l)
    local m = {}
    local n = {
        0x428a2f98,
        0x71374491,
        0xb5c0fbcf,
        0xe9b5dba5,
        0x3956c25b,
        0x59f111f1,
        0x923f82a4,
        0xab1c5ed5,
        0xd807aa98,
        0x12835b01,
        0x243185be,
        0x550c7dc3,
        0x72be5d74,
        0x80deb1fe,
        0x9bdc06a7,
        0xc19bf174,
        0xe49b69c1,
        0xefbe4786,
        0x0fc19dc6,
        0x240ca1cc,
        0x2de92c6f,
        0x4a7484aa,
        0x5cb0a9dc,
        0x76f988da,
        0x983e5152,
        0xa831c66d,
        0xb00327c8,
        0xbf597fc7,
        0xc6e00bf3,
        0xd5a79147,
        0x06ca6351,
        0x14292967,
        0x27b70a85,
        0x2e1b2138,
        0x4d2c6dfc,
        0x53380d13,
        0x650a7354,
        0x766a0abb,
        0x81c2c92e,
        0x92722c85,
        0xa2bfe8a1,
        0xa81a664b,
        0xc24b8b70,
        0xc76c51a3,
        0xd192e819,
        0xd6990624,
        0xf40e3585,
        0x106aa070,
        0x19a4c116,
        0x1e376c08,
        0x2748774c,
        0x34b0bcb5,
        0x391c0cb3,
        0x4ed8aa4a,
        0x5b9cca4f,
        0x682e6ff3,
        0x748f82ee,
        0x78a5636f,
        0x84c87814,
        0x8cc70208,
        0x90befffa,
        0xa4506ceb,
        0xbef9a3f7,
        0xc67178f2
    }
    for g = 1, 16 do
        m[g] = s232num(h, e + (g - 1) * 4)
    end
    for g = 17, 64 do
        local o = m[g - 15]
        local p = bit.bxor(bit.rrotate(o, 7), bit.rrotate(o, 18), bit.rshift(o, 3))
        o = m[g - 2]
        local q = bit.bxor(bit.rrotate(o, 17), bit.rrotate(o, 19), bit.rshift(o, 10))
        m[g] = (m[g - 16] + p + m[g - 7] + q) % 2 ^ 32
    end
    local r, s, b, t, u, v, w, x = l[1], l[2], l[3], l[4], l[5], l[6], l[7], l[8]
    for e = 1, 64 do
        local p = bit.bxor(bit.rrotate(r, 2), bit.rrotate(r, 13), bit.rrotate(r, 22))
        local y = bit.bxor(bit.band(r, s), bit.band(r, b), bit.band(s, b))
        local z = (p + y) % 2 ^ 32
        local q = bit.bxor(bit.rrotate(u, 6), bit.rrotate(u, 11), bit.rrotate(u, 25))
        local A = bit.bxor(bit.band(u, v), bit.band(bit.bnot(u), w))
        local B = (x + q + A + n[e] + m[e]) % 2 ^ 32
        x = w
        w = v
        v = u
        u = (t + B) % 2 ^ 32
        t = b
        b = s
        s = r
        r = (B + z) % 2 ^ 32
    end
    l[1] = (l[1] + r) % 2 ^ 32
    l[2] = (l[2] + s) % 2 ^ 32
    l[3] = (l[3] + b) % 2 ^ 32
    l[4] = (l[4] + t) % 2 ^ 32
    l[5] = (l[5] + u) % 2 ^ 32
    l[6] = (l[6] + v) % 2 ^ 32
    l[7] = (l[7] + w) % 2 ^ 32
    l[8] = (l[8] + x) % 2 ^ 32
end
_LOCALCRYPT.hash = function(h)
    h = preproc(h, #h)
    local l = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}
    for e = 1, #h, 64 do
        k(h, e, l)
    end
    return str2hexa(
        num2s(l[1], 4) ..
            num2s(l[2], 4) ..
                num2s(l[3], 4) .. num2s(l[4], 4) .. num2s(l[5], 4) .. num2s(l[6], 4) .. num2s(l[7], 4) .. num2s(l[8], 4)
    )
end


updatedKey = _LOCALCRYPT.encrypt(_LOCALCRYPT.hash('_SIGNED'..rawKey), '_SIGNED')
local function checkKey(key)
 return _LOCALCRYPT.encrypt(_LOCALCRYPT.hash('_SIGNED'..key), '_SIGNED')==updatedKey
end
-- Implement the checkKey function into whatever key system you use! Just instead of checking if the RAW key (for example password, password123, ...) is equal to the input, Check if the hashed input is equal to the hashed key to prevent skids from bypassing your key system OR just make it a little bit more secure, I am actively trying to find bypasses for this.

Features & Information

Join https://discord.gg/gYhqMRBeZV This script helps you protect your key system from being easily bypassed with a few hooks. What this does: Takes a raw key (as input) and hashes it. function checkKey: Checks if a hashed version of the key is equal to the hashed target key (The key you're using for your key system) FAQ: How does this prevent hooks? It doesnt. It just makes your keys nearly impossible to get without doing whatever key system you're using, for example linkvertise. Is this secure? Yes! I'm updating this whenever i find any vulnerability How do i use this? First of all, Please DO NOT USE THIS RAW!! Use this in an obfuscated script, Do not just put the code and expect your key system to be safe!! If it is raw it can still be hooked. There are many methods to bypass key systems that I will not leak for privacy reasons. Okay, but HOW DO I ACTUALLY USE THIS?? First of all, the easiest step: Copy the code and paste it into your script. Change the 'rawKey' variable to whatever your key is. Second step: Do NOT use the raw checkKey function as it can be hooked and EASILY bypassed. Copy the code from inside it and put it into where ever you're using it. For example: KeyTextBox.FocusLost:Connect(function() if _LOCALCRYPT.hash('_SIGNED'..key)==updatedKey then print("Oh nice you got the key correct") else print("Key is incorrect.") end end) v1.0.1: Added basic Caesar Cipher encryption
#KeySystem#Free#Hasher#Op#Universal

Community Comments (5)

The_script_userThe_script_userMay 23, 2024(edited)

Why do we need an betterkeysystem for what?

vxstyvxstyMay 23, 2024(edited)

@yoan_hristov So your key system does not get bypassed with 3 hooks.

The_script_userThe_script_userMay 23, 2024(edited)

Oh ok

YTeber112YTeber112Jun 30, 2024(edited)

better key system its babavabava

ragdoller2000ragdoller2000Jul 19, 2024(edited)

@YTeber112 lol

More Scripts for Universal Scripts