Skip to main content

Posts

Showing posts from October, 2015

Nothing to Fear

Armand Jean du Plessis, Cardinal-Duke of Richelieu and Fronsac, 17th century Prime Minister of France, reputedly said something to the effect of: "Give me six lines written by an honest man and I will find something in it to hang him with". There are probably many things he said, that he didn't say, but it is a nice quote. Beware of a Man in a Dress The French encrypted communications up to the early 19th century, using simple ciphers known as petits chiffres . These were short notes, based on 50 numbers. Later, they began to write letters using a combination of 150 numbers, known as the Army of Portugal Code.  By 1812, new cipher tables were sent from Paris based on 1400 numbers and derived from a mid-18th century diplomatic code.  18th Century Paris Cipher Many people think that 'If you have nothing to hide, then you have nothing to fear' , or simply state 'I have nothing

Reading and Parsing Data from Serial Ports

Read, Echo, Octal Dump, Head, Cat, Chat and Serial Ports Anyone who tried to parse data from a serial port in a Bash script will have run into trouble really quickly.  This post explores a few different methods. Some people prefer using minicom and expect , others just want to read a prompt from an embedded target such as an Arduino and send it a file without spending too much time on learning new tricks.  The best way to do it is the way that works for you! Rather than fighting with an actual serial port ( /dev/ttyUSB0 ), most of these examples use echo and pipes to send binary and ASCII data to a parsing utility to show what it does and how to use it. In a nut shell, if you need to parse human readable ASCII data, use read .  If you have to parse unreadable binary data, use od or head .  If it has to be very fast, use cat .  Read has a built-in timeout that you can use to keep it from getting stuck waiting forever.  The others, you have to kill with a timer when