UNPKG

webssh2-server

Version:

A Websocket to SSH2 gateway using xterm.js, socket.io, ssh2

39 lines (38 loc) 1.4 kB
// app/config/algorithm-presets.ts // Pure data module for SSH algorithm presets /** * Predefined SSH algorithm presets for different security profiles * @pure */ export const ALGORITHM_PRESETS = { modern: { cipher: ['aes256-gcm@openssh.com', 'aes128-gcm@openssh.com', 'aes256-ctr', 'aes128-ctr'], kex: ['ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521'], hmac: ['hmac-sha2-256', 'hmac-sha2-512'], compress: ['none', 'zlib@openssh.com'], serverHostKey: ['ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', 'ssh-rsa'], }, legacy: { cipher: ['aes256-cbc', 'aes192-cbc', 'aes128-cbc', '3des-cbc'], kex: ['diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'], hmac: ['hmac-sha1', 'hmac-md5'], compress: ['none', 'zlib'], serverHostKey: ['ssh-rsa', 'ssh-dss'], }, strict: { cipher: ['aes256-gcm@openssh.com'], kex: ['ecdh-sha2-nistp256'], hmac: ['hmac-sha2-256'], compress: ['none'], serverHostKey: ['ecdsa-sha2-nistp256'], }, }; /** * Get algorithm preset by name * @param presetName - Name of the preset (modern, legacy, strict) * @returns Algorithm configuration or undefined if not found * @pure */ export function getAlgorithmPreset(presetName) { return ALGORITHM_PRESETS[presetName.toLowerCase()]; }