Skip to content

Instantly share code, notes, and snippets.

@yuchan
Created April 10, 2012 01:34
Show Gist options
  • Save yuchan/2347819 to your computer and use it in GitHub Desktop.
Save yuchan/2347819 to your computer and use it in GitHub Desktop.
Encryption By Hash
#! /usr/bin/env python
#-*- coding:utf-8 -*-
import os
import hashlib
from datetime import *
remote_addr = os.environ["REMOTEHOST"]
current_time = datetime.now()
ct = current_time.strftime("%y%m%d%H%M%S")
h = hashlib.new("md5")
h.update(remote_addr)
h.update(ct)
print h.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment