# 
# Copyright © 2025 Thomas von Dein
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 

# encrypt something
exec env ANYDB_PASSWORD=12345 anydb -f test.db set -e secret eshishinusan

# retrieve it
exec env ANYDB_PASSWORD=12345 anydb -f test.db get secret
stdout eshishinusan

# but has it really been encrypted?
! exec env ANYDB_PASSWORD=8d8d8 anydb -f test.db get secret 
! stdout eshishinusan
stderr 'message authentication failed'

# what about the listing
exec anydb -f test.db ls -l
stdout 'encrypted-content'
! stdout eshishinusan

# and the export?
exec anydb -f test.db export -o -
! stdout eshishinusan
