/usr/share/pyshared/ncrypt/test/hash.py is in python-ncrypt 0.6.4-0ubuntu8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | from ncrypt import digest
import filterprog
def filterMain( inFile, outFile, args ) :
digestName = args.get( '-h', 'MD5' )
try :
digestType = digest.DigestType( digestName )
except digest.DigestError :
print 'Unknown digest: %s' % digestName
return
d = digest.Digest( digestType )
while 1 :
data = inFile.read( 1024 )
if not data : break
d.update( data )
print>>outFile, d.digest().encode('hex')
inFile.close()
outFile.close()
if __name__ == '__main__' :
filterprog.main( filterMain, 'h:', '[-h <hash-func>]' )
|