https://github.com/romanow/password-encryptor
Example for encryption text with OpenSSL and decrypt using Kotlin
https://github.com/romanow/password-encryptor
kotlin openssl
Last synced: 7 days ago
JSON representation
Example for encryption text with OpenSSL and decrypt using Kotlin
- Host: GitHub
- URL: https://github.com/romanow/password-encryptor
- Owner: Romanow
- Created: 2022-02-21T08:46:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-21T17:11:02.000Z (over 4 years ago)
- Last Synced: 2025-10-19T17:55:25.451Z (9 months ago)
- Topics: kotlin, openssl
- Language: Kotlin
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Password Encoder
На Mac OS можно использовать стандартный LibreSSL 2.8.3.
```shell
$ content="Hello, world"
$ password="secret"
# encrypted=$(./encrypt.sh "$password" "$content")
$ encrypted=$(echo -n "$content" |
openssl enc -aes-256-cbc \
-base64 -A \
-md sha256 \
-pass pass:$password)
$ echo "Encrypted value [$encrypted]"
Encrypted value [U2FsdGVkX1+eWX8x+srdjfVc/W7I9Lqpa2S3hunYtNE=]
$ ./gradlew clean build
BUILD SUCCESSFUL in 2s
4 actionable tasks: 4 executed
$ java -jar build/libs/password-encryptor.jar "$password" "$encrypted"
Hello, world
```