repo stringclasses 302
values | file_path stringlengths 18 241 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 76 697k | tokens int64 10 271k |
|---|---|---|---|---|---|
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/examples/Password.luau | luau | .luau | --[=[
Password Storage System using BLAKE3
This system uses BLAKE3 for password hashing instead of Argon2id.
Idea:
Argon2id intentionally slows down each hash to make brute force attacks expensive.
This is needed when users choose their own passwords, as human chosen passwords
are predictable and exist in ... | 894 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/scripts/run-tests.server.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Cryptography = ReplicatedStorage:WaitForChild("Cryptography")
local Tests = Cryptography.Testing
for _, Test: ModuleScript in Tests:GetChildren() do
require(Test)
end
return nil
| 57 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Checksums/Adler.luau | luau | .luau | --[=[
Cryptography library: Adler
Return type: number
Example Usage:
local Message = buffer.fromstring("Hello World")
local Hash = Adler(Message)
--]=]
--!strict
--!optimize 2
--!native
local function Adler(Message: buffer): number
local MOD_ALDER = 65522
local Sum = bit32.band(bit32.rshift(MOD_ALDER, 16),... | 1,493 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Checksums/CRC32.luau | luau | .luau | --[=[
Cryptography library: CRC32
Function can return JAM or ISO-HDLC CRC32 checksums.
Return type: number in regular mode, string in hex mode
Example Usage:
local Message = buffer.fromstring("Hello World")
--------Usage Case 1--------
local Hash = CRC32(Message)
--------Usage Case 2--------
local H... | 695 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Checksums/init.luau | luau | .luau | --!strict
local Algorithms = table.freeze({
CRC32 = require("@self/CRC32"),
Adler = require("@self/Adler")
})
return Algorithms | 35 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Encryption/AEAD/ChaCha.luau | luau | .luau | --[=[
Cryptography library: ChaCha20
Sizes:
Nonce: 12/24 bytes
Key: 16/32 bytes
Return type: buffer
Example usage:
local Data = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
local Nonce = buffer.fromstring(string.rep("n", 12))
--------Usage Case 1--------
l... | 5,680 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Encryption/AEAD/Poly1305.luau | luau | .luau | --[=[
Cryptography library: Poly1305
Sizes:
Key: 32 bytes
Tag: 16 bytes
Return type: buffer
Example usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
local Tag = Poly1305(Message, Key)
--]=]
--!strict
--!optimize 2
--!native
local TAG_SIZE ... | 2,497 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Encryption/AEAD/init.luau | luau | .luau | --[=[
Cryptography library: ChaCha20-Poly1305 AEAD
Sizes:
Key: 16/32 bytes
Nonce: 12/24 bytes
Tag: 16 bytes
Rounds: even positive integer (default: 20)
Return type: buffer, buffer (ciphertext, tag)
Example usage:
local Plaintext = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string... | 2,117 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Encryption/AES.luau | luau | .luau | --[=[
Cryptography library: AES
Sizes:
Init Vector: 16 bytes
Key Size: 16 / 24 / 32 bytes
Example usage:
local Key = CSPRNG.RandomBytes(32)
local IV = CSPRNG.RandomBytes(12)
local Message = "This is a secret message"
local Plaintext = buffer.fromstring(Message)
local AAD = buffer.fromstring("user:john... | 11,019 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Encryption/Simon.luau | luau | .luau | --[=[
Cryptography library: Simon Cipher 64-bit
⚠️ WARNING: Simon is not very secure!
For security, use AES or CHACHA20. ⚠️
Sizes:
Key: 16 bytes
Return type: buffer
Example Usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring("MySecretKey12345")
local Encrypted = Enc... | 2,088 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Encryption/Speck.luau | luau | .luau | --[=[
Cryptography library: Speck
⚠️ WARNING: Speck is not very secure!
For security, use AES or CHACHA20. ⚠️
Sizes:
Key: 8 bytes
Return type: buffer
Example Usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring("Key")
local Encrypted = Encrypt(Message, Key)
local De... | 2,257 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Encryption/XOR.luau | luau | .luau | --[=[
Cryptography library: XOR Symmetric Cipher
⚠️ WARNING: XOR is not cryptographically secure!
Do not use the same key twice!
For security, use AES or CHACHA20. ⚠️
Return type: buffer
Example Usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring("MySecretKey12345") -- Fas... | 839 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Encryption/init.luau | luau | .luau | --!strict
local Algorithms = table.freeze({
AEAD = require("@self/AEAD"),
AES = require("@self/AES"),
XOR = require("@self/XOR"),
Simon = require("@self/Simon"),
Speck = require("@self/Speck")
})
return Algorithms | 62 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/Blake2b.luau | luau | .luau | --[=[
Cryptography library: BLAKE2b
Return type: string
Example usage:
local Message = buffer.fromstring("Hello World")
-- BLAKE2b-128 (128-bit output)
local Result128 = BLAKE2b(Message, 16)
-- BLAKE2b-256 (256-bit output)
local Result256 = BLAKE2b(Message, 32)
-- BLAKE2b-384 (384-bit output)
... | 8,620 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/Blake3.luau | luau | .luau | --[=[
Cryptography library: Blake3
Sizes:
Key: 32 bytes
Output: variable
Return type: string (hex)
Example usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
--------Standard Hash--------
local Hash = Blake3.Digest(Message, 32)
--------... | 5,225 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/HKDF/HMAC.luau | luau | .luau | --[=[
Cryptography library: HMAC
Return type: string or function
Example usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring("Key")
local BlockSize = 64 -- SHA256 block length (= string.len(SHA256(...)))
local Result = HMAC(Message, Key, SHA2.SHA256, BlockSize) -- SHA3/... | 726 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/HKDF/init.luau | luau | .luau | --[=[
Cryptography library: HKDF (HMAC-based Key Derivation Function)
RFC 5869 extract-then-expand key derivation built on HMAC.
Return type: buffer
Example usage:
local IKM = buffer.fromstring("input key material")
local OKM = HKDF(IKM, Salt, Info, 32, SHA2.SHA256, 64, 32)
--]=]
--!strict
--!optimize 2
--!n... | 611 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/KMAC.luau | luau | .luau | --[=[
Cryptography library: KMAC (Keccak Message Authentication Code)
KMAC128 and KMAC256 are keyed hash functions based on cSHAKE128 and cSHAKE256.
They give variable length output and strong authentication.
Unlike SHAKE and cSHAKE, changing the output length generates a new,
unrelated output. Both variants s... | 9,312 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/MD5.luau | luau | .luau | --[=[
Cryptography library: MD5
⚠️ WARNING: MD5 is cryptographically broken!
Only use for legacy compatibility, checksums, or non-security purposes.
For security, use SHA256 or higher. ⚠️
Return type: string
Usage:
local Message = buffer.fromstring("Hello World")
local Result = MD5(Message)
--]=]
--!stri... | 1,996 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/Murmur.luau | luau | .luau | --[=[
Cryptography library: MurmurHash3-32
⚠️ WARNING: MurmurHash3 wasn't designed with cryptographic security in mind!
Only use for non-security purposes like hash tables or hyperloglog. For security, use SHA256 or higher. ⚠️
MurmurHash3 is a fast non-cryptographic hash that is well-distributed.
Return type... | 1,248 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/SHA1.luau | luau | .luau | --[=[
Cryptography library: SHA1
⚠️ WARNING: SHA1 is cryptographically broken!
Only use for legacy compatibility, checksums, or non-security purposes.
For security, use SHA256 or higher. ⚠️
Sizes:
Digest: 20 bytes
Return type: string
Example usage:
local Message = buffer.fromstring("Hello World")
-... | 1,268 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/SHA224.luau | luau | .luau | --[=[
Cryptography library: SHA224
Sizes:
Digest: 28 bytes
Return type: string
Example usage:
local Message = buffer.fromstring("Hello World")
local Result = SHA224(Message)
--]=]
--!strict
--!optimize 2
--!native
local CONSTANTS = buffer.create(256) do -- CONSTANTS = k
local RoundConstants = {
0x428a... | 1,815 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/SHA256.luau | luau | .luau | --[=[
Cryptography library: SHA256
Sizes:
Digest: 32 bytes
Return type: string
Example usage:
local Message = buffer.fromstring("Hello World")
local Result = SHA256(Message)
--]=]
--!strict
--!optimize 2
--!native
local CONSTANTS = buffer.create(256) do -- CONSTANTS = k
local RoundConstants = {
0x428a2... | 1,847 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/SHA384.luau | luau | .luau | --[=[
Cryptography library: SHA384
Sizes:
Digest: 48 bytes
Return type: (string, buffer)
Example usage:
local Message = buffer.fromstring("Hello World")
local Hash, HashBuffer = SHA384(Message)
--]=]
--!strict
--!optimize 2
--!native
local K_HI = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c2... | 4,903 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/SHA512.luau | luau | .luau | --[=[
Cryptography library: SHA512
Sizes:
Digest: 64 bytes
Return type: (string, buffer)
Example usage:
local Message = buffer.fromstring("Hello World")
local Hash, HashBuffer = SHA512(Message)
--]=]
--!strict
--!optimize 2
--!native
local K_HI = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c2... | 5,062 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/init.luau | luau | .luau | --[[
Cryptography library: SHA2 Family
--]]
return {
SHA224 = require("@self/SHA224"),
SHA256 = require("@self/SHA256"),
SHA384 = require("@self/SHA384"),
SHA512 = require("@self/SHA512"),
} | 59 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/SHA3.luau | luau | .luau | --[=[
Cryptography library: Keccak/SHA-3
Sizes:
SHA3-224 Digest: 28 bytes
SHA3-256 Digest: 32 bytes
SHA3-384 Digest: 48 bytes
SHA3-512 Digest: 64 bytes
SHAKE128 Digest: variable
SHAKE256 Digest: variable
Return type: string
Example usage:
local Message = buffer.fromstring("Hello World")
local ... | 7,716 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/XXH32.luau | luau | .luau | --[=[
Cryptography library: XXHash32
⚠️ WARNING: XXHash32 wasn't designed with cryptographic security in mind!
Only use for non-security purposes. For security, use SHA256 or higher. ⚠️
Return type: number
Example usage:
local Message = buffer.fromstring("Hello World")
--------Usage Case 1--------
local... | 2,006 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Hashing/init.luau | luau | .luau | --!strict
local Algorithms = table.freeze({
HMAC = require("@self/HMAC"),
HKDF = require("@self/HKDF"),
KMAC = require("@self/KMAC"),
MD5 = require("@self/MD5"),
SHA1 = require("@self/SHA1"),
SHA2 = require("@self/SHA2"),
SHA3 = require("@self/SHA3"),
XXH32 = require("@self/XXH32"),
Blake2b = require("@self/B... | 133 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Utilities/Base64.luau | luau | .luau | --[=[
Cryptography library: Base64
Return type: buffer
Example usage:
local Input = buffer.fromstring("Hello World")
local Encoded = Base64.Encode(Input)
local Decoded = Base64.Decode(Encoded)
--]=]
--!strict
--!optimize 2
--!native
local PADDING_CHARACTER = 61
local ALPHABET_BYTES = buffer.create(64) do
... | 3,196 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Utilities/CSPRNG/Blake3.luau | luau | .luau | --[=[
Cryptography library: Blake3
Sizes:
Key: 32 bytes
Output: variable
Return type: string (hex)
Example usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
--------Standard Hash--------
local Hash = Blake3.Digest(Message, 32)
--------... | 3,393 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Utilities/CSPRNG/ChaCha20.luau | luau | .luau | --[=[
Cryptography library: ChaCha20
Sizes:
Nonce: 12 bytes
Key: 16/32 bytes
Return type: buffer
Example usage:
local Data = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
local Nonce = buffer.fromstring(string.rep("n", 12))
--------Usage Case 1--------
loca... | 3,274 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Utilities/CSPRNG/Conversions.luau | luau | .luau | --[=[
Cryptography library: Conversions
Return type: string / buffer
Example Usage:
local HexString = Conversions.ToHex(buffer.fromstring("Hello World"))
local OriginalBuffer = Conversions.FromHex("48656c6c6f20576f726c64")
--]=]
--!strict
--!optimize 2
--!native
local ENCODE_LOOKUP = buffer.create(256 * 2) d... | 1,625 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Utilities/CSPRNG/init.luau | luau | .luau | --[=[
Cryptography library: Cryptographically Secure RNG
Usage:
local RandomFloat = CSPRNG.Random()
local RandomInt = CSPRNG.RandomInt(1, 100)
local RandomNumber = CSPRNG.RandomNumber(0.5, 10.5)
local RandomBytes = CSPRNG.RandomBytes(32)
local RandomHex = CSPRNG.RandomHex(16)
local FastString = CSPRNG.R... | 5,064 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Utilities/RandomString.luau | luau | .luau | --[=[
Cryptography library: Random String Generator
⚠️WARNING: This is not using cryptographically secure random numbers.
For Security use CSPRNG.⚠️
Return type: string | buffer
Example Usage:
local String = RandomString(500)
--]=]
--!strict
--!optimize 2
--!native
local function RandomString(Length: numb... | 159 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Utilities/init.luau | luau | .luau | --!strict
local Algorithms = table.freeze({
RandomString = require("@self/RandomString"),
Conversions = require("@self/Conversions"),
Base64 = require("@self/Base64"),
CSPRNG = require("@self/CSPRNG")
})
return Algorithms | 55 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/CSPRNG/Blake3.luau | luau | .luau | --[=[
Cryptography library: Blake3
Sizes:
Key: 32 bytes
Output: variable
Return type: string (hex)
Example usage:
local Message = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
--------Standard Hash--------
local Hash = Blake3.Digest(Message, 32)
--------... | 3,543 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/CSPRNG/ChaCha20.luau | luau | .luau | --[=[
Cryptography library: ChaCha20
Sizes:
Nonce: 12 bytes
Key: 16/32 bytes
Return type: buffer
Example usage:
local Data = buffer.fromstring("Hello World")
local Key = buffer.fromstring(string.rep("k", 32))
local Nonce = buffer.fromstring(string.rep("n", 12))
--------Usage Case 1--------
loca... | 3,202 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/CSPRNG/init.luau | luau | .luau | --[=[
Cryptography library: Cryptographically Secure RNG
Usage:
local RandomFloat = CSPRNG.Random()
local RandomInt = CSPRNG.RandomInt(1, 100)
local RandomNumber = CSPRNG.RandomNumber(0.5, 10.5)
local RandomBytes = CSPRNG.RandomBytes(32)
local RandomHex = CSPRNG.RandomHex(16)
local FastString = CSPRNG.R... | 5,064 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/Curve25519.luau | luau | .luau | --[=[
Cryptography library: Curve25519 Montgomery
Return type: varies by function
Example usage:
local Curve25519 = require("Curve25519")
local FieldQuadratic = require("FieldQuadratic")
--------Usage Case 1: Point multiplication--------
local BasePoint = Curve25519.G
local SomeScalar = FieldQuadratic.De... | 2,818 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/Edwards25519.luau | luau | .luau | --[=[
Cryptography library: Edwards25519
Return type: varies by function
Example usage:
local Edwards = require("Edwards25519")
local FieldQuadratic = require("FieldQuadratic")
--------Usage Case 1: Point addition--------
local Point1 = Edwards.Decode(SomeEncodedBuffer)
local Point2 = Edwards.Decode(Anot... | 11,461 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/FieldPrime.luau | luau | .luau | --[=[
Cryptography library: Field Prime (Curve25519 Base Field)
Return type: varies by function
Example usage:
local FieldPrime = require("FieldPrime")
--------Usage Case 1: Basic arithmetic--------
local ElementA = FieldPrime.Num(42)
local ElementB = FieldPrime.Num(17)
local Sum = FieldPrime.Add(Element... | 12,113 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/FieldQuadratic.luau | luau | .luau | --[=[
Cryptography library: Field Quadratic (Curve25519 Scalar Field)
Return type: varies by function
Example usage:
local FieldQuadratic = require("FieldQuadratic")
--------Usage Case 1: Basic scalar arithmetic--------
local ScalarA = FieldQuadratic.Decode(SomeBytes)
local ScalarB = FieldQuadratic.Decode(... | 3,927 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/MultiPrecision.luau | luau | .luau | --[=[
Cryptography library: Multi-Precision Arithmetic (264-bit integers)
Return type: varies by function
Example usage:
local MultiPrecision = require("MultiPrecision")
--------Usage Case 1: Basic arithmetic--------
local NumberA = MultiPrecision.Num(42)
local NumberB = MultiPrecision.Num(17)
local Sum ... | 5,898 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/SHA512.luau | luau | .luau | --!strict
--!optimize 2
--!native
local K_HI = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5... | 4,655 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/X25519.luau | luau | .luau | --[=[
Cryptography library: X25519 with cofactor clearing
Return type: varies by function
Example usage:
local AlicePrivate = CSPRNG.Ed25519Random()
local BobPrivate = CSPRNG.Ed25519Random()
local AliceMasked = X25519.Mask(AlicePrivate)
local BobMasked = X25519.Mask(BobPrivate)
local AlicePublic = X2551... | 2,513 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/CSPRNG/init.luau | luau | .luau | --[=[
Cryptography library: Cryptographically Secure RNG
Usage:
local RandomFloat = CSPRNG.Random()
local RandomInt = CSPRNG.RandomInt(1, 100)
local RandomNumber = CSPRNG.RandomNumber(0.5, 10.5)
local RandomBytes = CSPRNG.RandomBytes(32)
local RandomHex = CSPRNG.RandomHex(16)
local FastString = CSPRNG.R... | 5,064 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Field.luau | luau | .luau | --[=[
Finite field arithmetic modulo Q = 8380417
Arithmetic operations over the prime field Z_q where q = 2^23 - 2^13 + 1.
All operations maintain elements in canonical form [0, Q).
Example usage:
local Field = require(script)
local A = 12345
local B = 67890
local Sum = Field.Add(A, B)
local Product... | 451 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/NTT.luau | luau | .luau | --[=[
Number Theoretic Transform for degree-255 polynomials
Forward and inverse NTT over Z_q for polynomial multiplication.
Uses Cooley-Tukey and Gentleman-Sande algorithms with precomputed roots.
Example usage:
local NTT = require(script)
local Poly = buffer.create(256 * 4) -- 256 coefficients, 4 bytes ... | 1,459 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Pack.luau | luau | .luau | --[=[
Bit packing and unpacking utilities
Serializes polynomials to byte arrays with various bit widths.
Supports encoding/decoding of polynomial coefficients and hint bits.
Example usage:
local BitPacking = require(script)
local Poly = buffer.create(256 * 4)
local Encoded = buffer.create(96) -- For 3-b... | 5,403 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Params.luau | luau | .luau | --[=[
Parameter validation for ML-DSA algorithms
FIPS 204 specification.
Example usage:
local Params = require(script)
local IsValid = Params.CheckKeygenParams(4, 4, 13, 2) -- ML-DSA-44
local ValidEta = Params.CheckEta(2)
--]=]
--!strict
--!optimize 2
--!native
local Q = 8380417
local Params = {}
fun... | 993 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/PolyVec.luau | luau | .luau | --[=[
Vector operations on degree-255 polynomials
Works on vectors of polynomials including matrix multiplication,
NTT transforms, and encoding/decoding for ML-DSA.
Example usage:
local PolyVec = require(script)
local Vec = buffer.create(4 * 256 * 4) -- 4 polynomials
PolyVec.ForwardNTT(Vec, 4)
local N... | 9,419 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/SHA3.luau | luau | .luau | --!strict
--!optimize 2
--!native
local SHA3 = {}
local LOW_ROUND, HIGH_ROUND = buffer.create(96), buffer.create(96) do
local HighFactorKeccak = 0
local ShiftRegister = 29
local function GetNextBit(): number
local Result = ShiftRegister % 2
ShiftRegister = bit32.bxor((ShiftRegister - Result) // 2, 142 * Result... | 6,803 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Sampling.luau | luau | .luau | --[=[
ML-DSA Sampling
Example usage:
local Sampling = require(script)
local Rho = buffer.create(32)
local Matrix = buffer.create(4 * 4 * 256 * 4)
Sampling.ExpandA(Rho, Matrix, 4, 4)
--]=]
--!strict
--!optimize 2
--!native
local XOF = require("./XOF")
local Params = require("./Params")
local N = 256
lo... | 4,853 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Utils.luau | luau | .luau | --[=[
Utility functions for ML-DSA key and signature sizes
ML-DSA parameters.
Example usage:
local Utils = require(script)
local PubKeySize = Utils.PubKeyLen(4, 13) -- 1312 bytes for ML-DSA-44
local SecKeySize = Utils.SecKeyLen(4, 4, 2, 13) -- 2560 bytes
local SigSize = Utils.SigLen(4, 4, 131072, 80, ... | 448 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/XOF.luau | luau | .luau | --[=[
Stateful SHAKE XOF (Extensible Output Function)
Non-OOP implementation with reusable state buffers.
For ML-DSA sampling functions that use rejection sampling.
Example usage:
local XOF = require(script)
XOF.Reset128()
XOF.Absorb128(message)
local Chunk1 = XOF.Squeeze128(168)
local Chunk2 = XOF... | 8,128 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/init.luau | luau | .luau | --[=[
ML-DSA (FIPS 204) Digital Signature Algorithm
Post quantum digital signature scheme based on lattice cryptography.
Has three security levels: ML-DSA-44, ML-DSA-65, ML-DSA-87.
Example usage:
local MLDSA = require("@self/MlDSA")
local PubKey, SecKey = MLDSA.ML_DSA_44.GenerateKeys()
local Message = b... | 7,249 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Compression.luau | luau | .luau | --[=[
ML-KEM Compression Module
Polynomial coefficient compression and decompression operations for ML-KEM.
Maps field elements to and from reduced bit representations.
--]=]
--!strict
--!optimize 2
--!native
local Params = require("./Params")
local N = 256
local Q = 3329
local Compression = {}
function Compr... | 1,449 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Field.luau | luau | .luau | --[=[
ML-KEM Field Arithmetic Module
Prime field Zq arithmetic operations for ML-KEM.
Modular arithmetic over the field Z_q where q = 3329.
Example usage:
local Field = require(script.Field)
local Sum = Field.Add(1234, 567)
local Product = Field.Multiply(1234, 567)
local Inverse = Field.Invert(1234)
... | 511 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/NTT.luau | luau | .luau | --[=[
ML-KEM Number Theoretic Transform Module
Number Theoretic Transform (NTT) operations for polynomial multiplication.
Cooley-Tukey NTT and Gentleman-Sande inverse NTT algorithms
Example usage:
local NTT = require(script.NTT)
local Poly = buffer.create(512) -- 256 coefficients * 2 bytes
NTT.Ntt(Pol... | 3,057 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/PKE.luau | luau | .luau | --[=[
ML-KEM Public Key Encryption Module
K-PKE (CPA-secure public key encryption) implementation for ML-KEM.
Provides key generation, encryption, and decryption operations
as specified in NIST FIPS 203.
Example usage:
local PKE = require(script.PKE)
local Seed = buffer.fromstring("32_byte_seed_here..."... | 2,481 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Params.luau | luau | .luau | --[=[
ML-KEM Parameters Module
Parameter validation functions for ML-KEM.
NIST FIPS 203 specification.
Example usage:
local Params = require(script.Params)
local IsValid = Params.CheckKeygenParams(4, 2) -- true
local ValidD = Params.CheckD(11) -- true
local ValidEncrypt = Params.CheckEncryptParams(4,... | 722 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/PolyVec.luau | luau | .luau | --[=[
ML-KEM Polynomial Vector Module
Polynomial vector and matrix operations for ML-KEM.
Vector arithmetic, matrix multiplication, and encoding/decoding
operations on vectors of degree-255 polynomials.
--]=]
--!strict
--!optimize 2
--!native
local Ntt = require("./NTT")
local MlKemParams = require("./Params")
... | 1,569 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/SHA3.luau | luau | .luau | --!strict
--!optimize 2
--!native
local SHA3 = {}
local LOW_ROUND, HIGH_ROUND = buffer.create(96), buffer.create(96) do
local HighFactorKeccak = 0
local ShiftRegister = 29
local function GetNextBit(): number
local Result = ShiftRegister % 2
ShiftRegister = bit32.bxor((ShiftRegister - Result) // 2, 142 * Result... | 6,832 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Sampling.luau | luau | .luau | --[=[
ML-KEM Sampling Module
Polynomial sampling operations for ML-KEM.
Uniform sampling from Rq and centered binomial distribution sampling.
Example usage:
local Sampling = require(script.Sampling)
local Rho = buffer.create(32)
local Matrix = Sampling.GenerateMatrix(3, Rho, false)
local Sigma = ... | 1,932 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Serialize.luau | luau | .luau | --[=[
ML-KEM Serialization Module
Polynomial encoding and decoding operations for ML-KEM.
Converts polynomials to/from byte arrays with different bit lengths.
Example usage:
local Serialize = require(script.Serialize)
local Poly = buffer.create(512) -- 256 coefficients
local Encoded = Serialize.Encode... | 4,688 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Utils.luau | luau | .luau | --[=[
ML-KEM Utilities Module
Utility functions for ML-KEM implementation
Example usage:
local Utils = require(script.Utils)
local IsEqual = Utils.CtMemcmp(Buffer1, Buffer2)
Utils.CtCondMemcpy(Condition, Dest, Src1, Src2)
local PubKeySize = Utils.GetKemPublicKeyLen(4) -- 1568 bytes
local SecKeySi... | 1,023 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/init.luau | luau | .luau | --[=[
ML-KEM Main Module (Key Encapsulation Mechanism)
The complete ML-KEM post quantum key encapsulation.
Key generation, encapsulation, and decapsulation operations with
CCA security using the Fujisaki Okamoto transform.
Example usage:
local MlKem = require(script.MlKem)
local CSPRNG = require(script.CSP... | 2,691 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/Verification/init.luau | luau | .luau | --!strict
local Algorithms = table.freeze({
EdDSA = require("@self/EdDSA"),
MlDSA = require("@self/MlDSA"),
MlKEM = require("@self/MlKEM"),
})
return Algorithms | 48 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/src/init.luau | luau | .luau | --!strict
local Cryptography = table.freeze({
Hashing = require("@self/Hashing"),
Checksums = require("@self/Checksums"),
Utilities = require("@self/Utilities"),
Encryption = require("@self/Encryption"),
Verification = require("@self/Verification")
})
return Cryptography | 64 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/Adler.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: number
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Checksums/Adler")
local TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = 0x1 },
["a"] = { Description = "Single... | 454 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/Base64.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string,
Algorithm: "Encode" | "Decode"
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Utilities/Base64")
local TestVectors: TestVectors = {
["VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IG... | 680 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/Blake2b.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string,
OutLen: number?,
Key: string?
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/Blake2b")
local TestVectors: TestVectors = {
["abc"] = {
Description = "Basic ABC Test",
Expecte... | 6,247 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/Blake3.luau | luau | .luau | --!strict
local Testing = require("./")
local Algorithm = require("../Hashing/Blake3")
local New = {
Key = "whats the Elvish word for friend",
ContextString = "BLAKE3 2019-12-27 16:29:52 test vectors context",
Cases = {
{
InputLen = 0,
Hash = "af1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262... | 17,231 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/CRC32.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: number
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Checksums/CRC32")
local TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = 0x00000000 },
["The quick brown fox jum... | 553 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/CSPRNG.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Utilities/CSPRNG")
Testing.Describe("CSPRNG Algorithm Tests", function()
Testing.Test("Ed25519 Functions", function()
local Ed25519Bytes = ... | 3,006 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/MD5.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/MD5")
local TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = "d41d8cd98f00b204e9800998ecf8427e" },
["The... | 705 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/Murmur.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: number,
Seed: number
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/Murmur")
local TestVectors: TestVectors = {
[""] = {
Description = "Empty String (Seed 0x00)",
Expected = 0x000... | 1,095 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/SHA1.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/SHA1")
local TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = "da39a3ee5e6b4b0d3255bfef95601890afd80709" ... | 765 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/SHA224.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/SHA2/SHA224")
local TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = "d14a028c2a3a2bc9476102bb288234c415a... | 903 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/SHA256.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/SHA2/SHA256")
local TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = "e3b0c44298fc1c149afbf4c8996fb92427a... | 947 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/SHA3.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/SHA3")
local SHA3_224_TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = "6b4e03423667dbb73b6e15454f0eb1abd4... | 2,764 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/SHA384.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/SHA2/SHA384")
local TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = "38b060a751ac96384cd9327eb1b1e36a21f... | 1,204 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/SHA512.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: string
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/SHA2/SHA512")
local TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = "cf83e1357eefb8bdf1542850d66d8007d62... | 1,425 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/Simon.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Mode: "Encrypt" | "Decrypt",
Description: string,
Expected: string,
Key: buffer?,
Plaintext: string?,
}
type TestVectors = {[string]: TestVector}
local function FromHex(Hex: string): buffer
local Length = #Hex
local Buffer = buffer.create(Length / 2)... | 985 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/Speck.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Mode: "Encrypt" | "Decrypt",
Description: string,
Expected: string,
Key: buffer?,
Plaintext: string?,
}
type TestVectors = {[string]: TestVector}
local function FromHex(Hex: string): buffer
local Length = #Hex
local Buffer = buffer.create(Length / 2)... | 1,320 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/XOR.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Input: string,
Key: string,
}
local function ToHex(Buffer: buffer) : string
local Hex = ""
for Index = 0, buffer.len(Buffer) - 1 do
Hex ..= string.format("%02x", buffer.readu8(Buffer, Index))
end
return Hex
end
local XOR = req... | 1,144 |
daily3014/rbx-cryptography | daily3014-rbx-cryptography-a28191f/tests/XXH32.luau | luau | .luau | --!strict
local Testing = require("./")
type TestVector = {
Description: string,
Expected: number,
Seed: number?
}
type TestVectors = {[string]: TestVector}
local Algorithm = require("../Hashing/XXH32")
local TestVectors: TestVectors = {
[""] = { Description = "Empty String", Expected = 0x02cc5d05 },
["abc"] = {... | 985 |
Shiawaseu/RBLX-Whitelist | Shiawaseu-RBLX-Whitelist-da315fe/.vscode/luraph.d.luau | luau | .luau | -- Thanks Stefan
type GenericFunction<T, U...> = (U...) -> T;
declare function LPH_ENCFUNC<T, U...>(toEncrypt: GenericFunction<T, U...>, encKey: string, decKey: string): GenericFunction<T, U...>
declare function LPH_ENCSTR(toEncrypt: string): string
declare function LPH_ENCNUM(toEncrypt: number): number
declare funct... | 195 |
Sleitnick/Knit | Sleitnick-Knit-bb1ecf3/publish.luau | luau | .luau | -- Remodel Publish script
local KNIT_ASSET_ID = "5530714855"
print("Loading Knit")
local place = remodel.readPlaceFile("Knit.rbxl")
local Packages = place.ReplicatedStorage.Packages
Packages.Knit.Packages:Destroy()
print("Writing Knit module to model file...")
remodel.writeModelFile("Knit.rbxm", Packages)
print("Kni... | 122 |
Sleitnick/Knit | Sleitnick-Knit-bb1ecf3/src/init.luau | luau | .luau | local RunService = game:GetService("RunService")
if RunService:IsServer() then
return require(script.KnitServer)
else
local KnitServer = script:FindFirstChild("KnitServer")
if KnitServer and RunService:IsRunning() then
KnitServer:Destroy()
end
return require(script.KnitClient)
end
| 73 |
littensy/charm | littensy-charm-d0b7cff/bin/testez.d.luau | luau | .luau | declare function afterAll(callback: () -> ()): ()
declare function afterEach(callback: () -> ()): ()
declare function beforeAll(callback: () -> ()): ()
declare function beforeEach(callback: () -> ()): ()
declare function describe(phrase: string, callback: () -> ()): ()
declare function describeFOCUS(phrase: string, c... | 246 |
littensy/charm | littensy-charm-d0b7cff/packages/charm-sync/src/client.luau | luau | .luau | local Charm = require(script.Parent.Parent.Charm)
local patch = require(script.Parent.patch)
local types = require(script.Parent.types)
type AtomMap = types.AtomMap
type SyncPayload = types.SyncPayload
type ClientOptions = {
--[=[
The atoms to synchronize with the server.
]=]
atoms: AtomMap,
--[=[
Whether to i... | 478 |
littensy/charm | littensy-charm-d0b7cff/packages/charm-sync/src/flatten.luau | luau | .luau | local types = require(script.Parent.types)
type AtomMap = types.AtomMap
type NestedAtomMap = {
[string]: NestedAtomMap | () -> (),
}
local function flatten(atoms: NestedAtomMap): AtomMap
local result: AtomMap = {}
local function visit(node: NestedAtomMap, path: string)
for key, value in node do
local locatio... | 144 |
littensy/charm | littensy-charm-d0b7cff/packages/charm-sync/src/init.luau | luau | .luau | local client = require(script.client)
local flatten = require(script.flatten)
local patch = require(script.patch)
local server = require(script.server)
local types = require(script.types)
export type SyncPayload = types.SyncPayload
--[=[
Synchronizes state between the client and server. The server sends patches
to ... | 99 |
littensy/charm | littensy-charm-d0b7cff/packages/charm-sync/src/interval.luau | luau | .luau | local RunService = game:GetService("RunService")
--[=[
Schedules a function to be called at a fixed interval of `seconds`.
@param callback The function to call.
@param seconds The interval in seconds.
@return A function that cancels the interval.
]=]
local function interval(callback: () -> (), seconds: number): ... | 147 |
littensy/charm | littensy-charm-d0b7cff/packages/charm-sync/src/patch.luau | luau | .luau | local validate = require(script.Parent.validate)
local __DEV__ = _G.__DEV__
--[=[
A special symbol that denotes the absence of a value. Used to represent
deleted values in patches.
]=]
local None = { __none = "__none" }
local function isNone(value: any): boolean
return type(value) == "table" and value.__none == "... | 799 |
littensy/charm | littensy-charm-d0b7cff/packages/charm-sync/src/server.luau | luau | .luau | local Players = game:GetService("Players")
local Charm = require(script.Parent.Parent.Charm)
local interval = require(script.Parent.interval)
local patch = require(script.Parent.patch)
local types = require(script.Parent.types)
type AtomMap = types.AtomMap
type SyncPayload = types.SyncPayload
type ServerOptions = {
... | 1,678 |
littensy/charm | littensy-charm-d0b7cff/packages/charm-sync/src/types.luau | luau | .luau | local Charm = require(script.Parent.Parent.Charm)
type Atom<T> = Charm.Atom<T>
--[=[
A payload that can be sent from the server to the client to synchronize
state between the two.
]=]
export type SyncPayload = {
type: "init",
data: { [string | number]: any },
} | {
type: "patch",
data: { [string | number]: any }... | 102 |
littensy/charm | littensy-charm-d0b7cff/packages/charm-sync/src/validate.luau | luau | .luau | local SAFE_KEYS = { string = true, number = true }
local UNSAFE_VALUES = { ["function"] = true, thread = true }
local function isTableUnsafe(object: { [any]: any })
local keyType = nil
local objectSize = 0
-- All keys must have the same type
for key in next, object do
local currentType = type(key)
if not key... | 546 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.