TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

You won't remember the OpenSSL options, so here's bash shortcuts for everything

6 pointsby mikemaccanaover 9 years ago

4 comments

atoponceover 9 years ago
On the one hand, this is really quite good. I&#x27;m always interested in making my time at the command line more efficient. If I put this in my shell&#x27;s config, and remember the function names, I&#x27;m golden.<p>On the other hand, I&#x27;ve learned more from continuing to read the manpages than probably anything else. And the OpenSSL commands that I use frequently, such as connecting to a site with TLS, or checking a certificate chain, can now be easily recalled from memory, and I feel I&#x27;m better off for it, especially if I&#x27;m at a terminal where my OpenSSL functions might not be installed.
atoponceover 9 years ago
Encrypting files should probably include a salt-per-file, otherwise the same file contents will produce the same ciphertext when the same passphrase is provided.<p><pre><code> function openssl-encrypt() { openssl enc -aes-256-cbc -salt -in &quot;${1}&quot; -out &quot;${2}&quot; }</code></pre>
blakesterzover 9 years ago
This is great. Now I just need to remember the shortcuts! I have such a giant collection of bash short cuts in my .bashrc and other dotfiles that I can&#x27;t seem to remember ANY of them and end up just typing everything out in the end :-)
gt99over 9 years ago
function openssl-key-to-pin() { openssl rsa -in &quot;${1}&quot; -outform der -pubout | openssl dgst -sha256 -binary | openssl enc -base64 }<p>function openssl-website-to-pin() { openssl s_client -connect ${1}:443 | openssl x509 -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 }
评论 #10844840 未加载