MCPcopy Create free account
hub / github.com/adeljck/PassGet / Decrypt

Function Decrypt

modules/finalshell/decrypt.go:100–121  ·  view source on GitHub ↗
(data string)

Source from the content-addressed store, hash-verified

98 return hash[:]
99}
100func Decrypt(data string) (string, error) {
101 if data == "" {
102 return "", fmt.Errorf("empty data")
103 }
104
105 buf, err := base64.StdEncoding.DecodeString(data)
106 if err != nil {
107 return "", err
108 }
109
110 head := buf[:8]
111 d := buf[8:]
112
113 key := randomKey(head)
114
115 bt, err := desDecode(d, key)
116 if err != nil {
117 return "", err
118 }
119
120 return removeNonPrintableChars(string(bt)), nil
121}

Callers 1

GetConnDetailsFunction · 0.85

Calls 4

randomKeyFunction · 0.85
desDecodeFunction · 0.85
removeNonPrintableCharsFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected