Saturday, October 14, 2017

How to keep your Bitcoin safe

Here are a couple of tips on how to keep your bitcoin safer (not giving any guarantees though).

  • Use two factor authentication on ALL accounts that you use to access your Bitcoins or where you store information that can be used to access your Bitcoins.
    Examples are: Google AuthenticatorFIDO U2F.
  • On the above accounts, use a master password as the only restore option (no reset password by email or phone or use recovery questions). Write the master password down and store in a safe place. Do not store it digitally.
  • Do not store large amounts of Bitcoin in an exchange or other online holder. These providers are constantly under siege from hackers, and if you are unlucky, they hack your Bitcoins away from you.
  • Do store large amounts of Bitcoin in a hardware wallet that YOU trust. Examples are: TREZORLedger Nano S
  • Backup and test the backup scheme of your wallet. For example, if you have a backup phrase for your wallet, test that you can recreate the wallet with the phrase, preferably using some other wallet or tool. You can experiment on the BIP39 - Mnemonic Code page, but use the page offline, since you are exposing your private keys.
  • Do store large amounts of Bitcoin in a paper wallet. A paper wallet is essentially a public/private keypair that you store on paper. The public key is the address you pay to. The private key is used to swipe the wallet when you want to use the funds.
    To generate a keypair, you can use a website, for example Bitcoin Paper Wallet Generator, or you can use a software wallet that exports private keys. Important is that you generate the keypair offline. If you use a wallet to generate keypairs: Delete wallet after the you have exported the keypairs to paper (before going online). Also, many wallets use a system where a private key is used as a seed for the next private key, so if one of the generated private keys is compromised, consider the other keys as compromised as well.  To be safe, use one keypair per generated wallet.
    You can add the public key as a watch address in a wallet. It is totally safe, since you only use your public key.
    You can test that the keypair works, before sending funds to it: 
  • If your cell phone is a part of your authentication scheme, consider what would happen if someone stole it. Is your passcode safe enough (what if someone watched when you enter it on the subway, or in a surveillance camera)? If not, what is accessible if someone got into it? Email? Google authenticator codes? How weak is your weakest link?
  • Be security conscious. Having Bitcoins make you a target for hackers. Keep up to date, for example by listening to Security Now.


    If any of these tips where of use, please consider a tip to Bitcoin address: 15twH56pZbrTn2SX2vnpRX9z8FoiTZf7sX

    Monday, February 8, 2016

    40m Ham radio receiver using a NE602

    I've been building a circuit I found in "Experimental methods in RF design". It's a 40m AM/SSB/CW receiver using a NE602. I've been doing some experimentation to get the receiver working, especially with the local oscillator. In the book, they recommend a toroid wound coil, but I couldn't get that to oscillate. Finally I made an air wound coil, which worked. But since the coil was wound "mid air", it picked up even the smallest vibration in the surroundings, leading to a very unstable oscillation. I solved it by shoving a roll of paper inside the coil. I also worked some on getting the antenna input filter better matched.
    It receives between 6.9 and 7.4MHz, but it hasn't got a lot of selectivity, which I will try to solve somehow. Also, I want to interface the LO to a frequency counter, so I need to build a buffer amplifier to not load down the oscillator.
    Here are some images of the receiver and the schematics so far:
    Receiver circuit board. Antenna input, with attenuator pot seen to the left. Tuning caps on the right.
    Receiver with shielding in place. Tuning knobs to the left.
    Receiver diagram.

    Interfacing old telephone to PIC

    The old telephone has two ingoing lines. These are balanced inputs, one at about 48V on  hook, in respect to the other. I will call the 48V line positive and the other negative, even though they sometimes are the other way around.
    To make a simple and quick conversion circuit, I want to use a PICS general I/O, with a max input of 5V. The phone's positive line has three levels when dialing with pulses. 48V (hook on) , ~10V (hook off) and 0V low level during dialing. I want the PIC to see the two low levels as 0, and the high level as 1. I also need to protect the PIC against over voltage  during ringing, when the line goes through 110V AC with 30Hz frequency. During ringing I also need to protect against negative voltages.
    Since the PIC has ESD protection in the form of diodes on the IO's, I could rely on them to do the voltage protection. This seems like a bad idea though, since they are poorly speced in the datasheet and the data sheet advice against using them this way. The built in diodes has a voltage drop of about 0.6V. To beat these diodes I put in a BAT54 in the same fashion This is a Schottky diode with 0.35V forward voltage drop, so that it shunts overvoltage before the internal diodes.
    Here's what the interface looks like:
    Phone line to PIC I/O interface

    and the board so far:
    Interface and PIC along with a row of LEDs. Phone line connectors to the left, top and bottom.

    I've tested having the PIC flash an LED when detecting high/low level, and there seems to be no spurious errors with this setup. Next step is to start counting pulses with the right time spacing, and register what number is dialed.

    Thursday, January 7, 2016

    Old telephone conversion

    I found an old rotary phone on a flea market and decided toplug it in. My land line goes through the cable modem, which doesn't support this old way of entering the phone number. What I need todo is convert the pulses of the phone to dual tone multi frequency tones. Step one is to reverse engineer the old phone interface. I connected a scope to the connected phone plug and got these signals:
    On hook.
    Off hook, with speach.


    Receiving ringing.

    Dialling a "4".
    My initial thoughts is to connect these signals to a microcontroller to count pulses, and then let the microcontroller inject the right dialling tones on the line. First thing to do is to solder phone plug connectors to a perfboard to see if I can convert the 48V signals to logic levels (3.3V on 5V tolerant ports is my thought).






    Friday, June 5, 2015

    Annoying Beeping Prank Circuit

    Since i quit my old job last week, and I had the last day more or less alone in the office, I made a few loving pranks on my coworkers. One of them was a simple circuit based on a 555 timer. The circuit is simply a pulse oscillator with a couple of minutes between pulses. The circuit is seen here:
    556 Pulse oscillator
    The 1M Ohm resistor sets outputs high time together with the capacitor. The 100 Ohm resistor and capacitor sets the low time. This setup gives the inverse output of what I wanted to drive the buzzer (should be any buzzer with internal oscillator that can be driven by 9V), but it needed to be that way to keep power consumption low. If the resistors where swapped, the DIS-pin would discharge the power rail through the 100 Ohm resistor instead of the capacitor. To invert the output i used a second 555 as an inverter. In this configuration the circuit drew 8mA, which would give a couple of days use with a 9V, 580mAh battery.
    Google told  me there was a CMOS-based low power version of the chip, TLC556. That chip was pin compatible and used up 0.3mA. This gave a run time of about 80 days which I was very happy with.
    The circuit simply gave a short, loud beep every few minutes. I hid it in my colleagues flower pot and it took him quite a while to find it.. ;)
    Implemented circuit

    Sunday, April 12, 2015

    MIDI2VC+, a MIDI driven Voltage Controller

    The MIDI2VC+, v2, is finally finished. These are the implemented features:
    MIDI2VC+, v2, primary side.

    MIDI2VC+, v2, secondary side.

    • 5 octaves 1V/octave VC output
    • 3V gate output
    • Low note priority
    • Filters channel number, plays any MIDI-note regardless of channel
    • MIDI input and USB-MIDI input. Prioritise USB if both are connected.
    • Reset button
    • Pitch bend, 2 semitones in each direction
    • Input voltage 8-35V (high input voltage may need heat sink on regulators)
    • 5us trigger output
    • Powers USB-keyboard
    • USB interface tested on Korg MicroKEY 25
    • RCA jacks as outputs. Used RCA wires are easy to find very cheap, and jacks can easily be salvaged from scrapped audio equipment.
    • Both code and hardware is open source licensed to CERN OHL v.1.2.
    The PCB needs two straps. The MIDI input to the micro controller has no connection. Pin 4 on the optocoupler needs to be strapped to pin 24 on the micro controller. Also, the optocoupler needs to be powered from the 3V3 rail instead of the 5V. Before the optocoupler is mounted, one needs to cut out pin 6 and the pad from the pull-up resistor right besides it. When the optocoupler is mounted, strap a wire from pin 6 to the 3V3 rail.

    Cutout below optocoupler.
    Anyone is welcome to edit the layout files to fix the straps. I'm not going to do another version of the PCB at the moment. Eagle files and source code is available here.



    Monday, March 16, 2015

    Tinker-Box รก la Bob Pease

    I made a tinker-box, as recommended by Bob Pease in Troubleshooting Analog Circuits. It's simply a box of banana jacks connected to various resistors and capacitors. There is one rotary switch connected to resistors of values 10-66kOhms. There is a second rotary switch connected to capacitors of values 10p-1uF. Finally there is also a 100k potentiometer and a ferrite bead. Not much else to say about it other than that it's of great use when experimenting with op-amps. I used it when  i built last posts EMC-meter.
    Inside of tinker-box.

    Panel-side of tinker-box.