Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Added Sha256, Sha384, Sha512 and NTLM Hashing. LM is complicated and …
Browse files Browse the repository at this point in the history
…probaly needs passlib
  • Loading branch information
root committed Feb 21, 2016
1 parent 70a1ee5 commit d6f0d1c
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Context.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@
"command": "sha1",
"args": {}
},
{
"caption": "SHA256",
"command": "sha256",
"args": {}
},
{
"caption": "SHA384",
"command": "sha384",
"args": {}
},
{
"caption": "SHA512",
"command": "sha512",
"args": {}
},
{
"caption": "NTLM",
"command": "ntlm",
"args": {}
},
{
"caption": "Base64 Encode",
"command": "base64_encode",
Expand Down
20 changes: 20 additions & 0 deletions Main.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@
"command": "sha1",
"args": {}
},
{
"caption": "Hasher: SHA256",
"command": "sha256",
"args": {}
},
{
"caption": "Hasher: SHA384",
"command": "sha384",
"args": {}
},
{
"caption": "Hasher: SHA512",
"command": "sha512",
"args": {}
},
{
"caption": "Hasher: NTLM",
"command": "ntlm",
"args": {}
},
{
"caption": "Hasher: Base64 Encode",
"command": "base64_encode",
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Hasher is a small Sublime Text 2 & 3 Plugin that generates hashes from the selec

* MD5
* SHA1
* SHA256
* SHA384
* SHA512
* NTLM
* Base64 Encode
* Base64 Decode
* URI Component Encode
Expand Down
47 changes: 47 additions & 0 deletions hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,53 @@ def run(self, edit):
self.view.replace(edit, s, txt)


class Sha256Command(sublime_plugin.TextCommand):
def run(self, edit):
for s in self.view.sel():
if s.empty():
s = self.view.word(s)
selected = self.view.substr(s).encode('utf-8')
m = hashlib.sha256()
m.update(selected)
txt = m.hexdigest()
self.view.replace(edit, s, txt)


class Sha384Command(sublime_plugin.TextCommand):
def run(self, edit):
for s in self.view.sel():
if s.empty():
s = self.view.word(s)
selected = self.view.substr(s).encode('utf-8')
m = hashlib.sha384()
m.update(selected)
txt = m.hexdigest()
self.view.replace(edit, s, txt)


class Sha512Command(sublime_plugin.TextCommand):
def run(self, edit):
for s in self.view.sel():
if s.empty():
s = self.view.word(s)
selected = self.view.substr(s).encode('utf-8')
m = hashlib.sha512()
m.update(selected)
txt = m.hexdigest()
self.view.replace(edit, s, txt)


class NtlmCommand(sublime_plugin.TextCommand):
def run(self, edit):
for s in self.view.sel():
if s.empty():
s = self.view.word(s)
selected = str(self.view.substr(s))
m = hashlib.new('md4', selected.encode('utf-16le')).digest()
txt = str(binascii.hexlify(m)).upper().split('\'')[1]
self.view.replace(edit, s, txt)


class Base64EncodeCommand(sublime_plugin.TextCommand):
def run(self, edit):
for s in self.view.sel():
Expand Down

0 comments on commit d6f0d1c

Please sign in to comment.