efinf:blcks2017:crypto:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
efinf:blcks2017:crypto:start [2017/12/14 08:36]
Ivo Blöchliger [RSA]
efinf:blcks2017:crypto:start [2017/12/20 22:00]
Ivo Blöchliger [News]
Line 1: Line 1:
 +===== News =====
 +  * https://www.technologyreview.com/s/609771/a-cryptocurrency-without-a-blockchain-has-been-built-to-outperform-bitcoin/
 +
 +===== Theorie =====
 +  * Hashfunktion: https://de.wikipedia.org/wiki/Kryptologische_Hashfunktion
 +  * Asymmetrische Kryptographie: https://de.wikipedia.org/wiki/Asymmetrisches_Kryptosystem
 +  * Public-Key Verschlüsselung: https://de.wikipedia.org/wiki/Public-Key-Verschl%C3%BCsselungsverfahren
 +  * RSA-Verschlüsselung https://de.wikipedia.org/wiki/RSA-Kryptosystem
 ===== BadBlockChain ===== ===== BadBlockChain =====
 {{ :efinf:blcks2017:crypto:badblockchain.zip |BadBlockChain in Python}} {{ :efinf:blcks2017:crypto:badblockchain.zip |BadBlockChain in Python}}
Line 40: Line 48:
  
 ===== Anwendung BadBlockChain ===== ===== Anwendung BadBlockChain =====
 +=== Key Management ===
 +Key Erzeugen:
 +<code python makekey.py>
 +from  badkeymaterial import BadKeyMaterial
  
 +print BadKeyMaterial(32)
 +</code>
 +Ausgabe z.B.
 +  Public modulus: 4906493971 public exponent: 31  private exponent: 158269471
 +Key verwenden:
 +<code python initkey.py>
 +from  badkeymaterial import BadKeyMaterial
  
 +# modulus eintragen
 +k=BadKeyMaterial(4906493971)
 +# privaten Schlüssel setzen
 +k.private = 158269471
  
 +</code>
  
 +Mining:
 +<code python miner.py>
 +from badblockchain import BadBlockChain
 +from  badkeymaterial import BadKeyMaterial
 +
 +c = BadBlockChain()
 +c.getNewBlocks()  # Blockchain import
 +
 +# modulus eintragen
 +k=BadKeyMaterial(4906493971)
 +# privaten Schlüssel setzen
 +k.private = 158269471
 +
 +c.mine(k.modulus)
 +
 +print c.wallets.wallets
 +
 +</code>
 +
 +Neue Hash-Funktion:
 +<code python>
 +   # 32-Bit Hash
 +    @classmethod
 +    def badHash(cls,x):
 +        x = str(x)
 +        h = 0xdeadbeef
 +        for i in xrange(0,len(x)):
 +            h = ((h+6543)*(ord(x[i])+57361)+567) % 2**32
 +        return h
 +
 +</code>
  • efinf/blcks2017/crypto/start.txt
  • Last modified: 2017/12/20 22:08
  • by Ivo Blöchliger