using rot13 and tr command for having an encrypted email address

前端 未结 5 2109
旧时难觅i
旧时难觅i 2020-12-13 06:04

I have read many tutorials on the internet about the usage of the \'tr\' command. However, I am not able to understand how to encrypt an email address with a shell script sh

5条回答
  •  无人及你
    2020-12-13 06:28

    to simultaneously do ROT13 (for letters) and ROT5 (for numbers):

    tr 'A-Za-z0-9' 'N-ZA-Mn-za-m5-90-4'
    

    usage:

    echo test | tr 'A-Za-z0-9' 'N-ZA-Mn-za-m5-90-4'
    

    alias definition for your ~/.bashrc in case you need it more often:

    alias rot="tr 'A-Za-z0-9' 'N-ZA-Mn-za-m5-90-4'"
    

    (accurately rot135 or rot18)

提交回复
热议问题