cryptDecode returns the unencrypted file name
(cipher *crypt.Cipher, args []string)
| 68 | |
| 69 | // cryptDecode returns the unencrypted file name |
| 70 | func cryptDecode(cipher *crypt.Cipher, args []string) error { |
| 71 | var output strings.Builder |
| 72 | |
| 73 | for _, encryptedFileName := range args { |
| 74 | fileName, err := cipher.DecryptFileName(encryptedFileName) |
| 75 | if err != nil { |
| 76 | output.WriteString(fmt.Sprintln(encryptedFileName, "\t", "Failed to decrypt")) |
| 77 | } else { |
| 78 | output.WriteString(fmt.Sprintln(encryptedFileName, "\t", fileName)) |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | fmt.Print(output.String()) |
| 83 | |
| 84 | return nil |
| 85 | } |
| 86 | |
| 87 | // cryptEncode returns the encrypted file name |
| 88 | func cryptEncode(cipher *crypt.Cipher, args []string) error { |
no test coverage detected
searching dependent graphs…