<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic rfc1751.py in Scripts</title>
    <link>https://community.checkpoint.com/t5/Scripts/rfc1751-py/m-p/194975#M1130</link>
    <description>&lt;P&gt;rfc1751.py: &amp;nbsp;Python script to convert certificate fingerprint hash to ASCII words. &amp;nbsp;Useful for distributing a given certificate fingerprint to VPN clients and SmartConsole users to avoid fingerprint warnings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examples:&lt;/P&gt;
&lt;P&gt;./rfc1751.py&amp;nbsp;&lt;SPAN&gt;4607BC6AD16546324F12CD2D6EB43581&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ASCII fingerprint string:

WOW SPA HIM JOKE BEAK HAT AUNT HELD ALOE SKAT USE MUSH&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;./rfc1751.py AB:3A:04:87:F0:83:07:DC:B6:22:45:0C:CC:8E:5D:B9:3F:FE:C3:4C&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ASCII fingerprint string:

LAUD RISE KID SOAK OUR TORE MAIN EVA US HOBO SWAG SING&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With inline "openssl s_client":&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;./rfc1751.py $(openssl s_client -connect 192.0.2.1:443 -showcerts &amp;lt;/dev/null 2&amp;gt;/dev/null |sed -n -e '/0 s:/,/END CERT/p'|openssl x509 -noout -fingerprint -sha1|awk -F= '{print $2}')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2023-10-13 at 9.30.07 AM.png" style="width: 600px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/22809i6A174D9AB08BA294/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2023-10-13 at 9.30.07 AM.png" alt="Screen Shot 2023-10-13 at 9.30.07 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notes:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you are using the Windows certificate details view, the Thumbprint value is 40-bytes, long not 32, so that has to be truncated (which the script does). &amp;nbsp;Feel free to paste the whole 40-byte string as the argument. &amp;nbsp;If you are using openssl x509 -fingerprint, then use the -sha1 argument to get the SHA1 hash (may be default, but a newer openssl may change that some day).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;#!/usr/bin/python3

import sys, os
import binascii
from Crypto.Util import RFC1751

def main(argv=None):
  if argv is None:
      argv = sys.argv

  if not (len(argv)):
    print("Fingerprint hex string missing\n")
    print("Usage: {} &amp;lt;string&amp;gt;\n".format(__file__))
    print("String may be colon-separated hex (00:01:aa:bb...) or without colons (0001abcd...)\n")
    exit(1)
  
  fingerprint_arg=argv[0]
  fingerprint_str=fingerprint_arg.replace(':','')

  if (len(fingerprint_str) == 40):
    fingerprint_hex=fingerprint_str[:32]
  elif (len(fingerprint_str) == 32):
    fingerprint_hex=fingerprint_str
  else:
    print("Usage: {} &amp;lt;string&amp;gt;\n".format(__file__))
    exit(1)
    
  
  fingerprint_txt=RFC1751.key_to_english(binascii.unhexlify(fingerprint_hex[:32]))
  print("\nASCII fingerprint string:\n")
  print(fingerprint_txt)
  print("\n")

if __name__ == "__main__":
    main(sys.argv[1:])
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2023 13:30:36 GMT</pubDate>
    <dc:creator>Duane_Toler</dc:creator>
    <dc:date>2023-10-13T13:30:36Z</dc:date>
    <item>
      <title>rfc1751.py</title>
      <link>https://community.checkpoint.com/t5/Scripts/rfc1751-py/m-p/194975#M1130</link>
      <description>&lt;P&gt;rfc1751.py: &amp;nbsp;Python script to convert certificate fingerprint hash to ASCII words. &amp;nbsp;Useful for distributing a given certificate fingerprint to VPN clients and SmartConsole users to avoid fingerprint warnings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examples:&lt;/P&gt;
&lt;P&gt;./rfc1751.py&amp;nbsp;&lt;SPAN&gt;4607BC6AD16546324F12CD2D6EB43581&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ASCII fingerprint string:

WOW SPA HIM JOKE BEAK HAT AUNT HELD ALOE SKAT USE MUSH&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;./rfc1751.py AB:3A:04:87:F0:83:07:DC:B6:22:45:0C:CC:8E:5D:B9:3F:FE:C3:4C&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ASCII fingerprint string:

LAUD RISE KID SOAK OUR TORE MAIN EVA US HOBO SWAG SING&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With inline "openssl s_client":&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;./rfc1751.py $(openssl s_client -connect 192.0.2.1:443 -showcerts &amp;lt;/dev/null 2&amp;gt;/dev/null |sed -n -e '/0 s:/,/END CERT/p'|openssl x509 -noout -fingerprint -sha1|awk -F= '{print $2}')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2023-10-13 at 9.30.07 AM.png" style="width: 600px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/22809i6A174D9AB08BA294/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2023-10-13 at 9.30.07 AM.png" alt="Screen Shot 2023-10-13 at 9.30.07 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notes:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you are using the Windows certificate details view, the Thumbprint value is 40-bytes, long not 32, so that has to be truncated (which the script does). &amp;nbsp;Feel free to paste the whole 40-byte string as the argument. &amp;nbsp;If you are using openssl x509 -fingerprint, then use the -sha1 argument to get the SHA1 hash (may be default, but a newer openssl may change that some day).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;#!/usr/bin/python3

import sys, os
import binascii
from Crypto.Util import RFC1751

def main(argv=None):
  if argv is None:
      argv = sys.argv

  if not (len(argv)):
    print("Fingerprint hex string missing\n")
    print("Usage: {} &amp;lt;string&amp;gt;\n".format(__file__))
    print("String may be colon-separated hex (00:01:aa:bb...) or without colons (0001abcd...)\n")
    exit(1)
  
  fingerprint_arg=argv[0]
  fingerprint_str=fingerprint_arg.replace(':','')

  if (len(fingerprint_str) == 40):
    fingerprint_hex=fingerprint_str[:32]
  elif (len(fingerprint_str) == 32):
    fingerprint_hex=fingerprint_str
  else:
    print("Usage: {} &amp;lt;string&amp;gt;\n".format(__file__))
    exit(1)
    
  
  fingerprint_txt=RFC1751.key_to_english(binascii.unhexlify(fingerprint_hex[:32]))
  print("\nASCII fingerprint string:\n")
  print(fingerprint_txt)
  print("\n")

if __name__ == "__main__":
    main(sys.argv[1:])
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 13:30:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/rfc1751-py/m-p/194975#M1130</guid>
      <dc:creator>Duane_Toler</dc:creator>
      <dc:date>2023-10-13T13:30:36Z</dc:date>
    </item>
  </channel>
</rss>

