-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I'm using "sigtool" on various ubuntu 20.04 PCs. I'm using the same binary on all of them. Typically, it works OK.
However, on a certain type of PC, encryption produces a file that cannot be decrypted. Decryption produces an error
message like this:
sigtool: decrypt: can't decrypt chunk 0: cipher: message authentication failed
Any idea?
I've added a test script below. I've made "mixed tests" as well, meaning encrypt a file on
PC#A and decrypt it on PC#B. Outcome: Encryption doesn't work on the HP Z400 PCs.
Number|Encryption|Decryption|Decryption Status
------|----------|----------|---------------------------
1 |AnyPC |AnyPC |OK
2 |AnyPC |HP Z400 |OK
3 |HP Z400 |AnyPC |KO
4 |HP Z400 |HP Z400 |KO
Test Script
#!/bin/sh
#set -x
D="$(dirname "$0")"
D="$(cd "${D}" && pwd)"
SIGTOOL="${D}/sigtool"
test -x "${SIGTOOL}" || SIGTOOL="${D}/bin/linux-amd64/sigtool"
test -x "${SIGTOOL}" || { echo >&2 "Kann 'sigtool' nicht finden!"; exit 1; }
TMPDIR="${D}/tmp-$(openssl rand -hex 20)"
mkdir "${TMPDIR}"
HOME="${TMPDIR}/home"
export HOME
install -d -m 700 "${HOME}"
install -d -m 700 "${HOME}/.ssh"
echo $HOME
echo ~
ssh-keygen -t ed25519 -f "${HOME}/.ssh/id_ed25519" -P ""
SSH_KEY=id_ed25519
echo UliWarDa >"${TMPDIR}/clear"
"${SIGTOOL}" encrypt "$HOME/.ssh/${SSH_KEY}.pub" -o "${TMPDIR}/encrypted" "${TMPDIR}/clear"
"${SIGTOOL}" decrypt "$HOME/.ssh/${SSH_KEY}" -o "${TMPDIR}/clear-2" "${TMPDIR}/encrypted"
test "UliWarDa" != "$(cat "${TMPDIR}/clear-2")" && {
echo >&2 "Ver- und Entschlüsseln klappt nicht!"
rm -rf "${TMPDIR}"
exit 1
}
rm -rf "${TMPDIR}"OK Output
$ ./tests-uli.sh
/home/uli/git/forked/sigtool/tmp-19cb2ef3d7d3bb9979b22d5ef77ad23a962a9252/home
/home/uli/git/forked/sigtool/tmp-19cb2ef3d7d3bb9979b22d5ef77ad23a962a9252/home
Generating public/private ed25519 key pair.
Your identification has been saved in /home/uli/git/forked/sigtool/tmp-19cb2ef3d7d3bb9979b22d5ef77ad23a962a9252/home/.ssh/id_ed25519
Your public key has been saved in /home/uli/git/forked/sigtool/tmp-19cb2ef3d7d3bb9979b22d5ef77ad23a962a9252/home/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:bfVPpMQTqAPPP1jyeUDfSw7fdNAOL+QkdqSTvgTNn40 uli@ulicsl
The key's randomart image is:
+--[ED25519 256]--+
| oo. |
| . o=+*..|
| +.+BB+*.|
| .*+o*+O*|
| S oBooEo*|
| ...=..*.|
| .o .|
| |
| |
+----[SHA256]-----+
KO Output
Observed on two older HP Z 400 PCs.
$ ./tests-uli.sh
/tmp/sigtool/tmp-ddad7146f72a9ff2aa31a518f5d04fa9539a096e/home
/tmp/sigtool/tmp-ddad7146f72a9ff2aa31a518f5d04fa9539a096e/home
Generating public/private ed25519 key pair.
Your identification has been saved in /tmp/sigtool/tmp-ddad7146f72a9ff2aa31a518f5d04fa9539a096e/home/.ssh/id_ed25519
Your public key has been saved in /tmp/sigtool/tmp-ddad7146f72a9ff2aa31a518f5d04fa9539a096e/home/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:uZDrR+GaWNnDDsRJ9VXehcfwdr/nd3mx1P20ei5cxts agutjahr@agutjahr-z400
The key's randomart image is:
+--[ED25519 256]--+
| .. ..o+.|
| . . . ..o+|
| o . . ..=|
| +... .o|
| .o=S. . +|
| +o*. *=|
| o.*.. . +oX|
| ..o o o BE|
| .. .=.=|
+----[SHA256]-----+
/tmp/sigtool/bin/linux-amd64/sigtool: decrypt: can't decrypt chunk 0: cipher: message authentication failed
Ver- und Entschlüsseln klappt nicht!
Metadata
Metadata
Assignees
Labels
No labels