• 0

    posted a message on Cryptographically Secure Pseudo-Random Bit Generation
    For anyone interested, I built this initially in falstad.com's circuit simulator (http://www.falstad.com/circuit/) since it's easy to share and less esoteric for others than LTSPICE or similar. He also has android and iOS versions available.

    That's also why I consider it an "easy" design, because I can make something like this in a few minutes in a simulator it's just a matter of translating the circuit to redstone. Trying to design directly with redstone would be much harder, so don't do that.

    $ 1 5.0E-6 10.20027730826997 50 5.0 50
    155 288 320 432 320 0 0.0
    155 384 320 448 320 0 5.0
    155 480 320 512 320 0 5.0
    155 576 320 592 320 0 5.0
    R 288 352 176 352 1 2 100.0 2.5 2.5 0.0 0.5
    w 288 352 288 416 0
    w 288 416 384 416 0
    w 384 416 384 352 0
    w 384 416 480 416 0
    w 480 416 480 352 0
    w 480 416 576 416 0
    w 576 416 576 352 0
    d 224 320 288 320 1 0.805904783
    L 224 320 144 320 0 0 false 5.0 0.0
    d 288 256 288 320 1 0.805904783
    w 288 256 352 256 0
    w 864 416 864 352 0
    w 768 416 864 416 0
    w 768 416 768 352 0
    w 672 416 768 416 0
    w 672 416 672 352 0
    155 864 320 880 320 0 5.0
    155 768 320 800 320 0 0.0
    155 672 320 736 320 0 5.0
    w 576 416 672 416 0
    w 864 416 960 416 0
    w 1248 416 1344 416 0
    w 960 416 1056 416 0
    155 1056 320 1120 320 0 0.0
    155 1152 320 1184 320 0 0.0
    155 1248 320 1264 320 0 5.0
    w 1056 416 1056 352 0
    w 1056 416 1152 416 0
    w 1152 416 1152 352 0
    w 1152 416 1248 416 0
    w 1248 416 1248 352 0
    w 960 416 960 352 0
    155 960 320 976 320 0 5.0
    w 1632 416 1728 416 0
    w 1344 416 1440 416 0
    155 1440 320 1504 320 0 0.0
    155 1536 320 1568 320 0 0.0
    155 1632 320 1648 320 0 0.0
    w 1440 416 1440 352 0
    w 1440 416 1536 416 0
    w 1536 416 1536 352 0
    w 1536 416 1632 416 0
    w 1632 416 1632 352 0
    w 1344 416 1344 352 0
    155 1344 320 1360 320 0 5.0
    w 1728 416 1728 352 0
    155 1728 320 1744 320 0 5.0
    w 1728 416 1824 416 0
    155 3264 320 3280 320 0 0.0
    w 3264 416 3264 352 0
    155 2880 320 2896 320 0 0.0
    w 2880 416 2880 352 0
    w 3168 416 3168 352 0
    w 3072 416 3168 416 0
    w 3072 416 3072 352 0
    w 2976 416 3072 416 0
    w 2976 416 2976 352 0
    155 3168 320 3184 320 0 0.0
    155 3072 320 3104 320 0 5.0
    155 2976 320 3040 320 0 0.0
    w 2880 416 2976 416 0
    w 3168 416 3264 416 0
    155 2496 320 2512 320 0 0.0
    w 2496 416 2496 352 0
    w 2784 416 2784 352 0
    w 2688 416 2784 416 0
    w 2688 416 2688 352 0
    w 2592 416 2688 416 0
    w 2592 416 2592 352 0
    155 2784 320 2800 320 0 5.0
    155 2688 320 2720 320 0 5.0
    155 2592 320 2656 320 0 0.0
    w 2496 416 2592 416 0
    w 2784 416 2880 416 0
    w 2400 416 2496 416 0
    w 2112 416 2208 416 0
    155 2208 320 2272 320 0 0.0
    155 2304 320 2336 320 0 0.0
    155 2400 320 2416 320 0 0.0
    w 2208 416 2208 352 0
    w 2208 416 2304 416 0
    w 2304 416 2304 352 0
    w 2304 416 2400 416 0
    w 2400 416 2400 352 0
    w 2112 416 2112 352 0
    w 2016 416 2112 416 0
    w 2016 416 2016 352 0
    w 1920 416 2016 416 0
    w 1920 416 1920 352 0
    w 1824 416 1920 416 0
    155 2112 320 2128 320 0 5.0
    155 2016 320 2048 320 0 0.0
    155 1920 320 1984 320 0 0.0
    155 1824 320 1968 320 0 0.0
    w 1824 416 1824 352 0
    154 3168 224 3072 224 0 2 5.0
    154 3072 240 2976 240 0 2 5.0
    w 3168 320 3168 240 0
    w 3360 320 3360 208 0
    w 3360 208 3168 208 0
    w 3072 320 3072 256 0
    w 2496 320 2496 272 0
    154 2496 256 2368 256 0 2 5.0
    w 2976 240 2496 240 0
    w 2368 256 896 256 0
    w 896 256 352 256 0
    w 3360 320 3392 320 0
    R 3328 544 3248 544 1 2 50.0 2.5 2.5 0.0 0.25
    w 3360 480 3360 544 0
    w 3360 480 3440 480 0
    I 3360 608 3440 608 0 0.5
    155 3440 448 3456 464 0 5.0
    155 3440 576 3456 576 0 5.0
    155 3664 448 3696 448 0 5.0
    w 3360 544 3360 608 0
    w 3328 544 3360 544 0
    w 3392 320 3392 448 0
    w 3392 448 3440 448 0
    w 3392 448 3392 576 0
    w 3392 576 3440 576 0
    w 3536 448 3664 448 0
    w 3536 576 3664 576 0
    w 3664 576 3664 480 0
    M 3760 448 3888 448 0 2.5
    M 3664 576 3888 576 0 2.5
    o 128 64 0 34 5.0 9.765625E-5 0 -1
    o 129 64 0 34 5.0 9.765625E-5 0 -1
    Posted in: Redstone Creations
  • 0

    posted a message on Properinglish's Tutorials! *Update 12* Now with Part 1 of a Division Tutorial!
    Yep. Redstone is similar to, but very different from, digital logic in electronics.
    There are only 2 "voltage" states, on and off.
    There is no concept of current.
    There's no resistance, capacitance, or inductance.
    Everyone calls SR latches RS latches. I'm not sure why, though it makes no real difference.


    So any circuit that would use an op-amp can't be made. No 555-timers for redstone!
    But it's turing complete, so you could, say, create 8-bit registers and simulate the operation of a 555 with 256 values representing 256 levels of voltage and current.
    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Properinglish's Tutorials! *Update 12* Now with Part 1 of a Division Tutorial!
    The ones I'd really like to see would be the wiring/redstone specific tutorials. Partly because I already know plenty of digital logic and circuit design (computer/electrical engineering does need that stuff) and partly because the non-redstone specific stuff is generally pretty well covered in tutorials elsewhere.

    Most of my redstone problems are of the "Damnit, no insulation!" or the "How the hell do I make a filter without resistors, capacitors, inductors, or op-amps?" sort.
    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Cryptographically Secure Pseudo-Random Bit Generation
    So I wanted to make a cryptographically-secure PRBG in Minecraft. I'm a total redstone noob*, only had the game for about 2-3 weeks, so a nice simple project that won't take more than a few hours seemed good, and no one seems to have made such a beast before.

    First, a caveat: The generator I made is vulnerable to timing attacks, and the internal state is obviously visible. If you were going to actually use this you'd have to hide the innards, and also use a large buffer for the output. I've already spent about 6.5 hours on this, and covering it would prevent taking pictures, so I left that out. Making a buffer is pretty easy to do though, there's a single DFF for buffer but it's nowhere near enough.

    It's certaily possible to make this smaller. Being new to redstone and its assosciated weirdness (no insulation!) I chose to make it big to prevent errors. I didn't use locked repeaters because they're currently (1.4.2) buggy and don't work for shift registers properly.

    The generator I made is a type of CSPRBG called a "Self-Shrinking Generator". The basic design is as follows:
    Start with a Linear Feedback Shift Register.
    Clock 2 bits from the LFSR.
    If the first bit is 1 and the second 0, output 0.
    If the first bit is 1 and the second 1, output 1.
    Otherwise, output nothing.
    Clock 2 bits from the LFSR.... etc, etc.

    To differentiate between outputing 0 and outputing nothing I just have an output clock that only pulses when output is actually present.

    To start with I used Sethbling's pseudorandom pulse generators into an OR to allow for easy seeding/reseeding of the LFSR. A simple switch lets one turn this on and off.


    There's also a manual input, for testing and adding one's own seeds.


    A basic clock and pulse limiter (for use with low clock rates) into the LFSR.


    The 32-bit LFSR is based off of CrucialCraft's 16-bit design. I'd tried a version using 1-wide tileable DFFs but it was too hard to get the shifting to work (damn no insulation!) so I used the spaced out version.


    The primitive polynomial I used is 1 + x^23 + x^29 + x^30 + x^32, so the taps are at 32, 30, 29, and 23 (the 23-tap is a bit hidden in the pic, sorry. It's the same as the others.)


    The last bit of the LFSR gets output into the self-shrinking section, but 2 bits need to be captured, so I run a clock at half the original clock rate, then use that clock and its negation into a pair of DFFs to store the pair of bits. The S bit runs a switch (NPN transistor via piston and redstone) and the output clock, and the A bit is the output (when the S is 1) .

    The clock:


    Rising edge detectors to clock the DFFs:


    Overhead view of the DFFs and the switch:


    And the actual outputs, also shows the final buffer DFF:


    Imgur Album: http://imgur.com/a/xajEL

    Overall it was a fun project, not terribly advanced but that's fine for a beginner* like me.

    *New to redstone. Not new to digital logic & circuit design.
    Posted in: Redstone Creations
  • To post a comment, please .