4
Usage
Caffeine Fueled edited this page 2025-11-05 19:29:04 +00:00
Examples for alias in bash
## Optional: generate key, replace `mysecretkey`
openssl rand -hex 32
## Upload to linedump
ldup() {
local dir="${1:-.}"
local key="${2:-mysecretkey}"
tar cz "$dir" \
| openssl enc -aes-256-cbc -pbkdf2 -salt -base64 -pass pass:"$key" \
| curl -sS -X POST --data-binary @- https://linedump.com
}
## Download and extract from linedump in current directory
lddown() {
local paste_id="$1"
local key="${2:-mysecretkey}"
curl -s "https://linedump.com/${paste_id}" \
| base64 -d \
| openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:"$key" \
| tar xz
}
## Examples
# key is optional, as it would have been the default
ldup ./data mysecretkey
# replace `abc123` with paste_id of the upload
lddown abc123 mysecretkey
Transfer directories or binary files
Unencrypted:
Upload:
tar cvz ./data | base64 | curl -X POST --data-binary @- https://linedump.com
Download:
curl -s https://linedump.com/{paste_id} | base64 -d | tar xz
Encrypted:
Upload:
tar cz ./data \
| openssl enc -aes-256-cbc -pbkdf2 -salt -base64 -pass pass:yourkey \
| curl -sS -X POST --data-binary @- https://linedump.com
Download:
curl -s https://linedump.com/{paste_id} \
| base64 -d \
| openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey \
| tar xz
Encryption with GPG
Replace curl with any other tool that can send HTTP POST requests. Example on Linux.
Upload
- String:
echo "Cheers" | gpg --symmetric --armor | curl -X POST --data-binary @- https://linedump.com- File:
gpg --symmetric --armor file.txt -o - | curl -X POST --data-binary @- https://linedump.com- Command:
ip -br a | gpg --symmetric --armor | curl -X POST --data-binary @- https://linedump.com
Download
- Save to file:
curl -s https://linedump.com/{paste_id} | gpg --decrypt -o output.txt
Example
1. Upload
echo "Cheers" | gpg --symmetric --armor | curl -X POST --data-binary @- https://linedump.com
https://linedump.com/xGuiMp
Delete with HTTP POST: https://linedump.com/xGuiMp?token=x2NTpUh_JH7rwCdZ3gFDDAsCmAACkpYhZAaW0PP8
2. Checking encrypted content the server sees
curl https://linedump.com/xGuiMp
-----BEGIN PGP MESSAGE-----
jA0ECQMKjt5qCUrYoIj/0jwBPzikbS57PpJ0QR+5nlKXppAfkyVci7mI5kR3+zmC
HOQYztfu4JXW1sEGaH3OPD0KlmBwpWIpbuSU2VE=
=uRk1
-----END PGP MESSAGE-----
3. Download and decryption
curl -s https://linedump.com/xGuiMp | gpg --decrypt
gpg: AES256.CFB encrypted data
gpg: encrypted with 1 passphrase
Cheers
Encryption with age and SSH key pair
Upload
- String:
echo "Cheers" | age -R ~/.ssh/id_ssh.pub | base64 | curl -X POST --data-binary @- https://linedump.com- File:
age -R ~/.ssh/id_ssh.pub -o - file.txt | base64 | curl -X POST --data-binary @- https://linedump.com- Command:
ip -br a | age -R ~/.ssh/id_ssh.pub | base64 | curl -X POST --data-binary @- https://linedump.com
Download
- Save to file:
curl -s https://linedump.com/{paste_id} | base64 -d | age -d -i ~/.ssh/id_ssh > output3.txt