Files
supabase/apps/studio/components/interfaces/JwtSecrets/algorithmDetails.ts
T
Jonathan Summers-Muir 9591d8e04d added some info hover cards.
• found this this is probably the wrong direction
• will create a new page for next iteration.
2024-10-03 14:10:36 +08:00

82 lines
2.6 KiB
TypeScript

export interface AlgorithmDetail {
name: string
description: string
pros: string[]
cons: string[]
label: string
shortDescription: string
links: { url: string; label: string }[]
}
export const algorithmDetails: Record<string, AlgorithmDetail> = {
HS256: {
name: 'HMAC with SHA-256',
description: 'Symmetric algorithm using a shared secret key',
pros: [
'Fast and simple to use',
'Requires less computational power',
'Suitable for server-to-server communication',
],
cons: [
'Requires secure key exchange',
"Not suitable when the verifier shouldn't be able to sign tokens",
'Key needs to be kept secret on both sides',
],
label: 'HS256 (Symmetric)',
shortDescription: 'HMAC with SHA-256: Fast, simple, requires secure key exchange',
links: [
{ url: 'https://jwt.io/introduction', label: 'JWT.io Introduction' },
{
url: 'https://datatracker.ietf.org/doc/html/rfc7518#section-3.2',
label: 'RFC 7518 Specification',
},
],
},
RS256: {
name: 'RSA with SHA-256',
description: 'Asymmetric algorithm using a public/private key pair',
pros: [
'Allows public key to be distributed freely',
'Private key can be kept secret on the signing side',
"Suitable for scenarios where the verifier shouldn't be able to sign tokens",
],
cons: [
'Slower than HS256',
'Requires more computational power',
'Keys are larger than ECDSA keys',
],
label: 'RS256 (RSA)',
shortDescription: 'RSA with SHA-256: Allows public key distribution, slower',
links: [
{ url: 'https://jwt.io/introduction', label: 'JWT.io Introduction' },
{
url: 'https://datatracker.ietf.org/doc/html/rfc7518#section-3.3',
label: 'RFC 7518 Specification',
},
],
},
ES256: {
name: 'ECDSA with SHA-256',
description: 'Asymmetric algorithm using elliptic curve cryptography',
pros: [
'Faster than RSA',
'Smaller key and signature sizes compared to RSA',
'Provides forward secrecy',
],
cons: [
'Less widely supported than RSA',
'More complex to implement correctly',
'Requires careful implementation to avoid timing attacks',
],
label: 'ES256 (ECC)',
shortDescription: 'ECDSA with SHA-256: Compact keys, fast, modern alternative to RSA',
links: [
{ url: 'https://jwt.io/introduction', label: 'JWT.io Introduction' },
{
url: 'https://datatracker.ietf.org/doc/html/rfc7518#section-3.4',
label: 'RFC 7518 Specification',
},
],
},
}