Android-Password-Store/scripts/encrypt-secret.sh
Harsh Shandilya 6c1e41ba10
Revamp build configuration (#1156)
* release: move scripts to scripts directory

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* Move CI secrets to secrets directory

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* gradle: uprev to 6.7

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* gradle: suppress warnings about unsupported options

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* build: update dependencies

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* build: move Gradle plugins to ext

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* build: move configuration tasks to buildSrc

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* CHANGELOG: add entry for #1137

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* Fix lint warnings

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-10-16 17:18:11 +02:00

15 lines
501 B
Bash
Executable file

#!/usr/bin/env bash
set -ex
# Simple script that uses OpenSSL to encrypt a provided file with a provided key, and writes the result
# to the provided path. Yes it's very needy.
INPUT_FILE=$1
OUTPUT_FILE=$2
ENCRYPT_KEY=$3
if [[ -n "$ENCRYPT_KEY" && -n "$INPUT_FILE" && -n "$OUTPUT_FILE" ]]; then
openssl enc -aes-256-cbc -md sha256 -pbkdf2 -e -in "${INPUT_FILE}" -out "${OUTPUT_FILE}" -k "${ENCRYPT_KEY}"
else
echo "Usage: ./encrypt-secret.sh <input file> <output file> <encryption key>"
fi