password-obscura
Version:
A lightweight NPM package to visually obscure passwords or strings using customizable shift-based and symbol-mapping logic. Inspired by Caesar Cipher — reimagined for modern devs.
34 lines (30 loc) • 1.13 kB
TypeScript
interface SymbolMapConfig {
[key: string]: string;
}
declare const DEFAULT_SYMBOL_MAP: SymbolMapConfig;
interface DynamicTableConfig {
tables: string[];
shiftPattern: "even-odd" | "fibonacci" | "prime" | "custom" | "progressive";
customShifts?: number[];
baseShift?: number;
}
interface PolyalphabeticConfig {
keyword: string;
tables?: string[];
autoGenerate?: boolean;
}
declare const DEFAULT_TABLES: string[];
interface ObscureOptions {
method: "caesar" | "rot13" | "symbolMap" | "mirror" | "multiTable" | "polyalphabetic" | "advanced";
shift?: number;
symbolMap?: SymbolMapConfig;
tableConfig?: DynamicTableConfig;
polyConfig?: PolyalphabeticConfig;
layers?: Array<{
type: "table" | "shift" | "reverse" | "transpose";
config?: any;
}>;
}
declare function obscure(input: string, options: ObscureOptions): string;
declare function reveal(input: string, options: ObscureOptions): string;
export { DEFAULT_SYMBOL_MAP, DEFAULT_TABLES, type DynamicTableConfig, type ObscureOptions, type PolyalphabeticConfig, type SymbolMapConfig, obscure, reveal };