matiaskorhonen / paper-age

Easy and secure paper backups of secrets
MIT License
415 stars 8 forks source link

Output a warning if the input file is too large #12

Closed matiaskorhonen closed 1 year ago

matiaskorhonen commented 1 year ago

Adds a warning if the input file is too large. Only a warning though as the maximum size is slightly non-deterministic (but always around ~1952 bytes or so).

Crude test script to iterate through incrementally large inputs:

#!/bin/bash

counter=976

echo "Start $counter ($((counter * 2)) bytes)"

export PAPERAGE_PASSPHRASE="snakeoil"

while openssl rand -hex $counter | cargo run -- -f -;
do
  counter=$((counter + 1))
  echo "Loop $counter ($((counter * 2)) bytes)"
done

Will close #11.

github-actions[bot] commented 1 year ago

Code Coverage

Package Line Rate Health
src/builder.rs 96%
src/cli.rs 81%
src/main.rs 88%
tests/cli.rs 100%
src/encryption.rs 100%
src/builder/svg.rs 100%
Summary 94% (502 / 533)