MCPcopy Create free account
hub / github.com/F12FLASH/CTF / encodeFlag

Function encodeFlag

7.GraphQL Apocalypse/server/crypto/flagEncoder.ts:20–26  ·  view source on GitHub ↗
(flag: string)

Source from the content-addressed store, hash-verified

18}
19
20export function encodeFlag(flag: string): string {
21 const step1 = rot13(flag);
22 const step2 = xorEncode(step1, 42);
23 const step3 = Buffer.from(step2).toString('base64');
24
25 return step3;
26}
27
28export function decodeFlag(encoded: string): string {
29 const step1 = Buffer.from(encoded, 'base64').toString('utf-8');

Callers 2

testFlagEncoder.tsFile · 0.90
resolvers.tsFile · 0.90

Calls 2

rot13Function · 0.85
xorEncodeFunction · 0.85

Tested by

no test coverage detected