Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
323 views
p='1010011110101010100011110011110010100010101011011010111110101001111101101011111000100010110010101100101100111011001101001011101000110000100110001001100100011001' Integer=int(str(p)[::1], base=2); print Integer;
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_80.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cD0nMTAxMDAxMTExMDEwMTAxMDEwMDAxMTExMDAxMTExMDAxMDEwMDAxMDEwMTAxMTAxMTAxMDExMTExMDEwMTAwMTExMTEwMTEwMTAxMTExMTAwMDEwMDAxMDExMDAxMDEwMTEwMDEwMTEwMDExMTAxMTAwMTEwMTAwMTAxMTEwMTAwMDExMDAwMDEwMDExMDAwMTAwMTEwMDEwMDAxMTAwMScKSW50ZWdlcj1pbnQoc3RyKHApWzo6MV0sIGJhc2U9Mik7CnByaW50IEludGVnZXI7"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpIOM8KX/___code___.py", line 2, in <module> _sage_const_2 = Integer(2); _sage_const_1 = Integer(1) TypeError: 'long' object is not callable
#fingerprint data df=20; print Integer(df).binary()
10100
import csv data = list(csv.reader(open(DATA+'sample2.csv'))) row_count = sum(1 for row in data) print 'Jumlah Baris ',row_count #Calculate Hash Data Fingerprint Information def hash(dat): data1=int(dat[0]); binData1=Integer(data1).binary(); str1=str(binData1); data2=int(dat[1]); binData2=Integer(data2).binary(); str2=str(binData2); conbin=str1 + str2 return conbin FingerList = [] for k in range(len(data)): b=hash(data[k]) FingerList.append(b) print FingerList;
Jumlah Baris 9 ['1010011110'] ['1010011110', '1010101000'] ['1010011110', '1010101000', '111100111100'] ['1010011110', '1010101000', '111100111100', '1010001010'] ['1010011110', '1010101000', '111100111100', '1010001010', '1011011010111'] ['1010011110', '1010101000', '111100111100', '1010001010', '1011011010111', '110101001111'] ['1010011110', '1010101000', '111100111100', '1010001010', '1011011010111', '110101001111', '111000100010'] ['1010011110', '1010101000', '111100111100', '1010001010', '1011011010111', '110101001111', '111000100010', '11001010'] ['1010011110', '1010101000', '111100111100', '1010001010', '1011011010111', '110101001111', '111000100010', '11001010', '110010110']
#Import Fingerprint Information import csv data = list(csv.reader(open(DATA+'sample.csv'))) row_count = sum(1 for row in data) print 'Jumlah Baris ',row_count #Calculate Hash Data Fingerprint Information def hash(dat,rows): fingerprint=(int(dat[0])+int(dat[1]))^(rows-1) return fingerprint FingerList = [] for k in range(len(data)): b=hash(data[k],row_count) FingerList.append(b) #print FingerList cs=sum(FingerList) HashData=hex(Integer(cs)) print 'Hash Data ',HashData print 'Jumlah ',cs
Jumlah Baris 10 Hash Data 10b835516f9e233ca Jumlah 19276344387245847498
number_of_bits(490088992307915995655096600517116307373623713346356)
169
#Convert Password To Hex Password = 'vita1234' from sage.crypto.util import ascii_integer bin=BinaryStrings() B=bin.encoding(Password); d='101001111010101010001111001111001010001010101101101011111010100111110110101111100010001011001010110010110'; e=str(B); c = d+e; IntegerPassword=int(str(c)[::1], base=2); #Compute Number Of Bit import math def number_of_bits(n): return int(math.log(n, 2)) + 1 bitKeccakInput=number_of_bits(IntegerPassword); HexCombination=hex(IntegerPassword); print 'A Number Bit Combination ',bitKeccakInput; print 'A Number Hex Combination ',HexCombination; #Keccak Hash Function load DATA+"Keccak.py" Keccak=Keccak() BioKey = Keccak.Keccak((bitKeccakInput,HexCombination),1152,448,28,224,True) print BioKey
Create a Keccak function with (r=1152, c=448, d=28 (i.e. w=64)) String ready to be absorbed: 0x14f551e79455b5f53ed7c4595967669746131323021C90010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 (will be completed by 56 x '00')
Traceback (most recent call last): e=str(B); File "", line 1, in <module> File "/tmp/tmpB4pTsj/___code___.py", line 23, in <module> BioKey = Keccak.Keccak((bitKeccakInput,HexCombination),_sage_const_1152 ,_sage_const_448 ,_sage_const_28 ,_sage_const_224 ,True) File "/home/irfan/.sage/sage_notebook.sagenb/home/admin/2/data/Keccak.py", line 336, in Keccak Pi=self.convertStrToTable(P[i*(2*r//8):(i+1)*(2*r//8)]+'00'*(c//8)) File "/home/irfan/.sage/sage_notebook.sagenb/home/admin/2/data/Keccak.py", line 168, in convertStrToTable output[x][y]=self.fromHexStringToLane(string[offset:offset+(2*self.w//8)]) File "/home/irfan/.sage/sage_notebook.sagenb/home/admin/2/data/Keccak.py", line 117, in fromHexStringToLane return int(temp, 16) ValueError: invalid literal for int() with base 16: 'b55594e751f5140x'
print Integer(30).binary()
11110
f='11110' b=int(str(f)[::1], base=2); print b;
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_87.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zj0nMTExMTAnCmI9aW50KHN0cihmKVs6OjFdLCBiYXNlPTIpOwpwcmludCBiOw=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpQxQXz0/___code___.py", line 2, in <module> _sage_const_2 = Integer(2); _sage_const_1 = Integer(1) TypeError: 'long' object is not callable
f='1010011110101010100011110011110010100010101011011010111110101001111101101011111000100010110010101100101100111011001101001011101000110000100110001001100100011001' b=int(str(f)[::1], base=2); print b;
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_91.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zj0nMTAxMDAxMTExMDEwMTAxMDEwMDAxMTExMDAxMTExMDAxMDEwMDAxMDEwMTAxMTAxMTAxMDExMTExMDEwMTAwMTExMTEwMTEwMTAxMTExMTAwMDEwMDAxMDExMDAxMDEwMTEwMDEwMTEwMDExMTAxMTAwMTEwMTAwMTAxMTEwMTAwMDExMDAwMDEwMDExMDAwMTAwMTEwMDEwMDAxMTAwMScKYj1pbnQoc3RyKGYpWzo6MV0sIGJhc2U9Mik7CnByaW50IGI7"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpwuDNbY/___code___.py", line 2, in <module> _sage_const_2 = Integer(2); _sage_const_1 = Integer(1) TypeError: 'long' object is not callable
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_26.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("YT0nMTAwMDAwMDEwMTAnCmFbOjRd"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpqUpKJ3/___code___.py", line 2, in <module> _sage_const_4 = Integer(4) TypeError: 'int' object is not callable
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_25.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bXlzdHIgPSAiYWJjZGVmZ2hpamtsIgpteXN0clstNDpd"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpZ1jXWI/___code___.py", line 2, in <module> _sage_const_4 = Integer(4) TypeError: 'int' object is not callable