SecureRandom
classin packageklyn.cryptography
public class SecureRandom extends Object
└ SecureRandom

Transport-safe secure random helper.

Uses the operating system's cryptographically secure random generator (CNG on Windows, getrandom on Linux), without loading an OpenSSL provider. The public API exposes hexadecimal and Base64 text encodings; it does not expose a raw Byte[] generation method.

import klyn.cryptography

random = SecureRandom()
print(random.nextHex(16))
Inherited Properties
propertyInherited Properties from Object: type
Constructors
Modifier and Type Member Description
public SecureRandom Creates a secure random generator instance.
Methods
Modifier and Type Member Description
public nextBase64
nextBase64(sizeBytes as Int) as String throws CryptoException
Generates random data encoded as standard Base64.
public nextHex
nextHex(sizeBytes as Int) as String throws CryptoException
Generates random data encoded as hexadecimal.
public nextUrlBase64
nextUrlBase64(sizeBytes as Int) as String throws CryptoException
Generates random data encoded as URL-safe Base64.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml