Base64 encode on shell

Sometimes you need to encode a string  with a base64 encoding. For example when trying to send a HTTP request with a Basic Authentication header like that:

As you can see the Basic Auth username and password are included in the request as a base64 encoded string.

On the Linux shell this string can be generated by the following command:

Im my blog post  Protect directory with username and password I show how to generate the password hash for Basic Auth via .htaccess file itself.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.