Skip to content

Instantly share code, notes, and snippets.

@gilangvperdana
Last active March 27, 2023 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilangvperdana/e7a7f60cd0e1add9b4b566ab64da51fa to your computer and use it in GitHub Desktop.
Save gilangvperdana/e7a7f60cd0e1add9b4b566ab64da51fa to your computer and use it in GitHub Desktop.
How to decrypt Base64 to Plaintext & Viceversa
import base64
base64_message = 'BASE64' # pesan yang ingin di-decode
decoded_message = base64.b64decode(base64_message) # proses decoding
print(decoded_message.decode('utf-8')) # print hasil decoding
@gilangvperdana
Copy link
Author

Base64 Generator

#!/bin/bash

# prompt user for input text
read -p "Enter the plain text to be encoded in base64: " plain_text

# encode the plain text using base64
encoded_text=$(echo -n $plain_text | base64)

# print the encoded text
echo "The base64 encoded text is: $encoded_text"

@gilangvperdana
Copy link
Author

Base64 Decryptor

#!/bin/bash

# prompt user for encoded message
read -p "Enter the base64 message to be decoded: " encoded_message

# decode the base64 message using base64 command
decoded_message=$(echo -n $encoded_message | base64 -d)

# print the decoded message
echo "The decoded message is: $decoded_message"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment