Shop OBEX P1 Docs P2 Docs Learn Events
Propcrytion — Parallax Forums

Propcrytion

DestructinatorDestructinator Posts: 34
edited 2010-08-02 18:23 in Propeller 1
To all those who are interested, Im beginning the process of figuring out a hardware based encryption system using the propeller architecture and the various cogs to supply multiple levels of encryption. If you are interested in this, I'll be able to fill things in as I go, but right now its just a theory. So if you want to know more later, leave a comment and if you have any sort of useful information about encryption systems please feel free to share. Any info would be appreciated

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams
«1

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2010-06-18 05:45
    I implemented 56bit encryption on a Z8 in a modem in the late 80's. There is code for the algorithm published somewhere - try the wiki.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • cessnapilotcessnapilot Posts: 182
    edited 2010-06-18 19:52
    Hi,


    I think the Propeller is a good platform to set up a fast AES-128 Processor, as the AES algorithm can be organized into pipelined parallel computations with 4x4 byte (4x32-bit) data. One needs one pipeline for the 'keyscheduling' and an other for the 'datapath'. In Prop two such pair of processes might run parallel (2x2 COGs). Two chunks of 16-byte data can be encrypted / decrypted in 10 rounds. In each round some data should be transferred between processes (once in one round). With a·quick GF(28) multiplication (only with seven small numbers including 1) and with some 256 byte table lookup Prop will shine. With a rather conservative estimate, 80-120 Kbyte of data may be encrypted / decrypted per second. The AES-258 needs more rounds and is accordingly slower somewhat. The question is, however, how to put that data in or get it out from the Prop?

    Cheers,

    Istvan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Intentionally Left Blank
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-06-19 03:28
    Now I recall. The DES algorithm was posted in Pascal. It was a short recursive routine in Pascal. Search the wiki.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • cessnapilotcessnapilot Posts: 182
    edited 2010-06-19 05:15
    @Cluso99:

    Yes, you can find FORTRAN, BASIC, Java, C, C++, C#, VB.NET and Python (or certainly more kind of) implementations. They came with many flavors of style: full algorithmic or full table lookup, or balanced between. All I have seen are sequential solutions, but the AES algorithm can be organized in two 'threads'. That would be more interesting and effective on a Propeller platform, than a 'simple' sequential code translation. Prop is able to run two such thread pairs (2x2 COGs) parallel. That is all that I tried to point out.

    Anyway, to fuel the 'Fast, Faster, Fastest Code' (for the Propeller) series of threads, the dreaded, but in fact simple Galois Field (2^8) multiplication seems to be a good candidate. Extremely rapid performance, like with the byte multiplication (more than one million multiplications· per second), can be obtained.

    Another thing. All high level language decommented source codes, are in the size 15-35Kbytes. For my taste, none of them are 'short recursive routines'. So, a 'simple' (public and really working) sequential translation for the Propeller would be a honorable task, either.

    Cheers,

    Istvan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Intentionally Left Blank
  • NarguleNargule Posts: 8
    edited 2010-06-19 14:58
    I'm interested in have an AES-128 cypher for the Prop, but don't we need a good source of sudo-random data to produce quality encryption?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Corwine
  • cessnapilotcessnapilot Posts: 182
    edited 2010-06-20 09:22
    Hi Tom,

    AES (Rijndael) is an advanced data encryption block cipher technique developed by Belgian cryptographers Joan Daemen and Vincent Rijmen. Its three versions (AES-128, AES-192, and AES-256) differ in their key sizes (128 bits, 192 bits and 256 bits) and in their number of rounds (10, 12, and 14, respectively). After a multi-year evaluation process, in 2001 the US Government chose AES as the new government standard (FIPS-197), replacing the older DES encryption standard. AES provides far greater security through much
    larger key size and an improved encryption algorithm.

    AES encrypts and decrypts 128-bit blocks of data with 3 standard key lengths:

    1) 128-bit key length that corresponds to approx. 3.4 x 10^38 keys
    2) 192-bit key length corresponding to approx···· 6.2 x 10^57 keys
    3) 256-bit key length corresponding to approx.··· 1.1 x 10^77 keys

    By comparison, DES has approx. 7.2 x 10^16 keys. To try and put this into perspective, if we assumed a super-computer could break the DES code in one second, it would take the same super computer 149 thousand billion years to decode an AES.

    In June 2003 the U.S. Government (NSA) announced that AES is secure enough to protect classified information up to the TOP SECRET level, which is the highest security level and defined as information which would cause "exceptionally grave damage" to national security if disclosed to the public.

    Up till now all attacks aren't effective against published full AES. The code is practically unbreakable (and God knows how many surplus rounds and what Sboxes are used by the agencies.)

    So, you do not have to use random keys, at all. Just keep your key secret. When I say secret, I MEAN SECRET! If one does not know your key he is NOT ABLE TO BREAKE THE CODE. Be the key random or not. Of course, some common sense applies here, too. Do not rely on the encryption algorithm alone when protecting your data. Be sure you select a password or rather a "pass phrase" that is difficult to guess but still easy for you to remember. Use a mix of lower-case/uppercase letters, digits and special characters. It is obvious not to use the null key, or just the name of your girlfriend. Such a key· was called "cilly" by the british code breakers, and the radio operators hunted eagerly for those transmissions, where the german operator used repeatedly for the message key a simple girl name or initials to set the disks of the enigma. Such cillies were collected and tried first and helped a lot to decrypt the messages and brake the system, as a whole. One of those german gays used EVA always.

    Note that in the encrypted byte stream any output byte can be a null, so it is not a simple string data.·

    Use OTP if you want even more security.

    Cheers,

    Istvan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Intentionally Left Blank

    Post Edited (cessnapilot) : 6/20/2010 9:28:17 AM GMT
  • DestructinatorDestructinator Posts: 34
    edited 2010-06-20 20:41
    Instead of using an AES system, what about a system that goes even more basic and encrypts on a binary level? My idea was to use the multiple processors on the chip, and have multiple sets of instructions such as every third byte is reversed and have a different set of instructions on each processor so it gets scrambled to the point where you would just be viewing useless data unless you had a decryption module that had a reverse set of instructions . . .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams
  • DestructinatorDestructinator Posts: 34
    edited 2010-06-21 01:55
    Cessnapilot said...
    The question is, however, how to put that data in or get it out from the Prop?
    My method for the data to get in and out of the prop is by way of RJ45 so it can be used as a network device and be powered by the network cable itself

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-06-21 03:31
    DES 56 or 64? should be fine for most needs. I implemented the DES algorithm in assembler in a Z8 micro which was a modem controller for a 9600 baud Rockwell chipset. It also had compression in the Z8. The Z8 was funning at 7.9872MHz. So a prop will eat this for breakfast!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • cessnapilotcessnapilot Posts: 182
    edited 2010-06-21 05:05
    AES is binary. An ASCII password is only a convenient way to enter a binary data up to 256-bit long. Cluso has right, DES-56 or 64 is easier to implement, and it would be a good start and it might be·appropriate even for a commercial product.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Intentionally Left Blank
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-06-21 06:11
    I like public key encryption.
    So much nicer than dealing with all the problems
    of distributing a secret key. But in the back of my
    mind I keep wondering if some genius has come
    up with a fast way to factor large primes.....? I
    know it seems unlikely, but the Germans felt it was
    unlikely anyone could crack that mechanical encryption
    machine they used in world war two. It just seemed
    so impossible to crack, we know how that went.

    A fast block cipher might be something you could implement
    well on a prop. There are some very fast and easy to code
    stream ciphers around too. But with some of the simple
    to code stream ciphers you need to be very careful or
    you can weaken the strength of the encryption.

    I believe that Chip Gracey wrote a random number generator
    for the prop that he claims actually generates true randomness.
    It's an amazing claim, not sure how to test it if actually can do this.

    "Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin."
    -- John von Neumann
  • NarguleNargule Posts: 8
    edited 2010-06-21 08:57
    cessnapilot said...
    Hi Tom,

    AES (Rijndael) is an advanced data encryption block cipher technique developed by Belgian cryptographers Joan Daemen and Vincent Rijmen....

    Yea, I know all that. What I was asking is if the cipher needs sudo random data to actually perform the encryption, or whether the only input needed is the plaintext and my key.

    EDIT: I see now - sudo random data is typically used for generating keys, not during the actual encrypting/decrypting. Makes sense, I'm not sure what I was thinking before.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Corwine

    Post Edited (Nargule) : 6/21/2010 9:53:54 AM GMT
  • heaterheater Posts: 3,370
    edited 2010-06-21 12:02
    Nargule: "sudo random data is typically used for generating keys, not during the actual encrypting/decrypting. "

    Depends. In order to protect yourself against "replay" attacks you should never send the same message twice.

    Example: I send the message "Turn left" (M) to my robot as an encrypted message E.
    My robot decrypts E and dutifully turns left.
    It is possible some bad guy can listen to the transmission of E and record it. Then he might be able to transmit it again to my robot. My robot dutifully turns left again.

    The attacker in this case need never decrypt the message in order to make use of it for his purposes.

    So a sequence numbers or pseudo random number sequence in your message, checked by the receiver, can be used to defeat replay attacks. Or mixing up the data or key with a random sequence.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • DestructinatorDestructinator Posts: 34
    edited 2010-06-21 13:34
    Wow, yall are providing lots of useful information. Right now Im going With Cessnapilot and looking into an AES and Clusso99 with DES. DES would be a good starting point and AES would be a better 2nd gen type thing. Im waiting on some components I ordered to connect the prop to RJ45, where I will try to encrypt data coming from my wall to my computer. Another method Im going to try is kinda like the Iron key method, and encrypt data on a flash drive via USB. Unlike the Iron Key, This will make it so that the encrpytion/decreyption module is not located on the device, but rather the prop would be a kind of docking station and you have to plug in the USB drive for the prop to decrypt and the computer to see useful data.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams
  • David CarrierDavid Carrier Posts: 294
    edited 2010-06-21 23:59
    Destructinator,
    Depending on your application, XXTEA may be a great place to start. It is a relatively simple cipher that is secure under almost any circumstance. There is a known attack that requires the encryption of known plaintexts. This means that if someone wanted your key, and you encrypted information they gave you, using your key, they could look at the result and determine your key. This would still require up to 5.76*10^17 attempts, which is impossibly large for a microcontroller. (With the smallest blocks, at 64 bits, that is more than 4.6 Exabytes) If you are only encrypting your own information, then even that won't break the cipher.

    — David Carrier
    Parallax inc.
  • NarguleNargule Posts: 8
    edited 2010-06-22 01:45
    heater said...
    Nargule: "sudo random data is typically used for generating keys, not during the actual encrypting/decrypting. "

    Depends. In order to protect yourself against "replay" attacks you should never send the same message twice.

    Right. My quote above is regarding a previous post of mine asking if sudo random data was needed for the AES-128 cipher to function. Of course, it isn't.

    Good point about replay attacks, though. I've thought about this somewhat; I'm thinking the transmitter and the receiver would either need synchronized clocks (in which case we just pre-pend the output of a RTC to the message) or the receiver would need to maintain a table of commands it's previously processed (which is different every time due to us adding random data to the message).

    Another thought is to implement something where a rolling code is used. I'm not sure how complicated that would be, but it seems like the most robust solution.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Corwine
  • DestructinatorDestructinator Posts: 34
    edited 2010-06-22 02:34
    Actually, I had another thought of how to synchronize the units. I am planning on replacing the EEprom with a MicroSD card to hold sets of instructions to encrypt data. With a MicroSD card even just the size of 1 Gb, you could store thousands of sets of instructions. These would all be numbered and when data is being sent to the module, a random number generator would select a set of instructions. When a set of instructions is selected, the packets of data are headed by a "tag" of sorts. The purpose of the Tag is to point to the set of instructions used to encrypt the data. The reason why Im going with the tags, is because the tags arent the key . . . they are merely pointers to sets of instructions, and If this is to be used for say a company, the instructions could be proprietary, so even if you know the tag, you wont have the instructions to decrypt the data. Let me know what you guys think of my idea

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams

    Post Edited (Destructinator) : 6/22/2010 2:41:30 AM GMT
  • $WMc%$WMc% Posts: 1,884
    edited 2010-06-22 03:39
    Destructinator

    I can break Your Proposed code that you haven't even writing yet. Heres how I would do it.
    I would simply read the data stream from the SD card and compare it to the reactions on the I/O pins.(Running this over and over) After I ran out of different patterns, I would just compare what did what. My PC doesn't have a problem running billions and billions of 0s and 1s

    I think the algorithm approach would work My PC a lot more.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA


    want speed?·want·to use the Propeller?·want to stay with BASIC___www.propbasic.com___


    You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.

    ·
  • TimmooreTimmoore Posts: 1,031
    edited 2010-06-22 03:57
    You have talked about replay attacks, another attack is modification attacks, encryption doesn't protect the data from being changed. Modified encrypted data will still decrypt but you will not get what you were expecting.
    And dont use a crc even a encrypted crc is straightforward to correct even through the encryption.
  • DestructinatorDestructinator Posts: 34
    edited 2010-06-22 12:48
    $WMc% said...
    Destructinator

    I can break Your Proposed code that you haven't even writing yet. Heres how I would do it.
    I would simply read the data stream from the SD card and compare it to the reactions on the I/O pins.(Running this over and over) After I ran out of different patterns, I would just compare what did what. My PC doesn't have a problem running billions and billions of 0s and 1s

    I can see what you are saying. But how would you get access to the SD card and I/O pins? This device is intended for say, network security, so its not going to be lying out in the open. Hardware based cryptographics is intended to be more difficult in that there is no software that can be hacked or cracked.This system is designed to have maximum effect with a minimal footprint, say about the size of a credit card.Your approach would indeed work, If you had access to the device, but anyone who is serious enough to buy a hardware based system, is not just going to leave it lying around to be hacked.

    If anyone else knows of anyway that this concept could be easily broken, please let me know. It helps me to strengthen the concept.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams
  • DestructinatorDestructinator Posts: 34
    edited 2010-06-22 13:03
    Good News Everyone! Yesterday I had the chance to build the base outline of how the hardware will work. All Im missing are the RJ45 connectors and breakout boards I ordered from sparkfun. And I fear I may be in over my head with the coding aspect. Does anyone have any advice on how I should go about this? The two rows of blue and yellow jumper wires lead to the section where the RJ45's will be, everything else is just a slightly modified propeller layout. I made some changes to minimalize the amount of space required. Sorry about the fuzzyness, my webcam isnt too terribly amazing . . .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams

    Post Edited (Destructinator) : 6/22/2010 1:10:55 PM GMT
    1280 x 1024 - 211K
    1280 x 1024 - 206K
  • $WMc%$WMc% Posts: 1,884
    edited 2010-06-23 01:01
    Destructinator

    Sorry for not paying attention, I see now that you want to make a Prop_hardware_key. This would be removed when one is done with the Application. So no Prop_hardware_key to hack. (sorry, I was thinking of a setup similar to a card in a cable/satellite TV set-top box, were the card was pretty vulnerable to a hacker.)

    With a hardware_key, you don't need a whole lot of encryption. Take a look at how an ignition key works on a late model vehicle, First a mechanical binary code to release the tumblers to get to the "ON" position with the ignition switch, Then you need the rite RFID tag code(thats in the key) for the CPU to enable the fuel injectors.

    If you implemented a number of trys and a time frame for your key to activate the Application, This would be very difficult to hack.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA


    want speed?·want·to use the Propeller?·want to stay with BASIC___www.propbasic.com___


    You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.

    ·
  • DestructinatorDestructinator Posts: 34
    edited 2010-06-24 00:07
    Naw, its fine. Its better when people bring up stuff like that. It helps me look at it from a different angle, so I can either find flaws, or reinforce my understanding of it. So, Im still waiting on those RJ45 jacks and breakouts . . . But it is my fault for getting the USPS shipping. Would anyone be interested if I made this into a pcb?I really need help with the coding too, Im in over my head with how to code this thing after reading up on the encryption systems that you all have posted advice on

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2010-06-24 03:53
    Timmoore said...
    You have talked about replay attacks, another attack is modification attacks, encryption doesn't protect the data from being changed. Modified encrypted data will still decrypt but you will not get what you were expecting.
    And dont use a crc even a encrypted crc is straightforward to correct even through the encryption.
    Take your data, compress it, do a·keyed-SHA hash (use something better than SHA-1 which has been shown to be breakabe), pad the beginning of your data with a "protocol agreed-upon" ammount of random data from a hardware noise generator (dual Zener-noise circuit with XOR "Von Nueman" common mode bit rejection), then >=AES128 encrypt.· Random data will ensure that the replay attack is deafeated (assuming sufficient padding, of suficient quality is used), Keyed-SHA hash ensures the data/sender integrity, compression makes dictionary attacks essentially impossible and may recover a bit of the space used with random data padding.

    Don't forget the·security of the·code itself - any encryption system is only as good as its weakest link, and having a leak on the·unencrypted-side (or unverified code on the sender/receiver) would let attackers peak into your plain-text before it's even encrypted...· You might want to try something the FPGA guys are doing now for anti-piracy, use a secure EEPROM and do a·hash of the·run-time code, send the·hash to the EEPROM for verification to ensure the platform is not tamplered with then expand your encryption/decryption engine from the EEPROM.

    Also, remember - if you are doing a short lifecycle data burst (data that is immediatey reacted to, like in an RC car/robot), you only need a secure channel for key exchange, and you can use a simple XOR with the·exchanged key to mask the data+checksum like a one-time-pad (very fast) - you'd have to tweak the data and the checksum CORRECTLY, for the packet to be hacked, and the less you use the secure key exchange channel, the harder it will be for an attacker to hijack the keystream.

    Post Edited (GreyBox Tim) : 6/24/2010 3:59:41 AM GMT
  • TimmooreTimmoore Posts: 1,031
    edited 2010-06-24 04:10
    Greybox Tim said...
    Take your data, compress it, do a·keyed-SHA hash (use something better than SHA-1 which has been shown to be breakabe), pad the beginning of your data with a "protocol agreed-upon" ammount of random data from a hardware noise generator (dual Zener-noise circuit with XOR "Von Nueman" common mode bit rejection), then >=AES128 encrypt.· Random data will ensure that the replay attack is deafeated (assuming sufficient padding, of suficient quality is used), Keyed-SHA hash ensures the data/sender integrity, compression makes dictionary attacks essentially impossible and may recover a bit of the space used with random data padding.

    If you are going down this route I would pick one of the aes modes that macs as well such as aes-ccm or aes-gcm. The get the xor stream and the mac with 1 set of operations·(so-so)·and 1 key and replay is built-in and the mode have been crypto designed/reviewed by some good crypto people.
    I should correct that statement strictly they dont provide replay but they require a nonce which is commonly an incrementing number which can be used as the replay counter·providing both with a single number.

    Post Edited (Timmoore) : 6/24/2010 4:32:37 AM GMT
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2010-06-25 06:49
    Timmoore said...
    ...I should correct that statement strictly they dont provide replay but they require a nonce which is commonly an incrementing number which can be used as the replay counter·providing both with a single number...
    Correct - missed that.· Put it in your message before keyed-hashing, compression, encryption - this ensures that the nonce isn't modified separately from the message contents, and when keyed-hashed, retains sender verification of the nonce.

    Assuming the RC transmit/receive pair:

    nonce && Message = PlainText
    PlainText && KeyedHash(PlainText) = SenderData
    Compress(SenderData) = Payload
    Encrypt(HW-RNG && Payload) = CipherText

    This requires on the receiving end that the following happen:

    Decrypt(CipherText) = HW-RNG, Payload· <-- Receiver must strip the correct number of bits to have the valid Payload
    Decompress(Payload) = SenderData
    Split(SenderData) = PlainText, KeyedHash <-- Receiver must split off the correct number of bits to sepearate the Hash from the data
    PlainText·== KeyedHash(PlainText) <-- if true, plaintext is valid; if false, discard data and NACK packet·(or reset link)
    Split(PlainText) = nonce, Message·<-- Receiver must split off the correct number of bits to separate the nonce from the message
    nonce > Lastnonce <-- if true, data is valid - set Lastnonce to nonce and ACK packet (only at this step); if false, discard data and NACK packet (or rest link)
    Act on data if valid


    For nonce you can do many different methods, a rolling counter, UNIX time (which would require more stringent syncronization of your system clocks), etc...

    Other recommendations, encryption keys can and should be changed regularly - the more often they are changed, the harder it is to crack the next transmission.· Keys for hashing, should be between two parties only - this is an added addressing measure (I think NIST suggested a public key method for checking keyed hash, but I don't recall).· Only the target that the message was intended for will be able to correctly verify the hash, all others will fail that check - this is one suggested solution to the Byzantene Generals Problem when data is forwarded·(but this is subject to correct implementation on the receive-side, the receiver could just decide to use the data anyway, and then you can kiss your security goodbye...).

    Initial key exchange should probably use Public-Key methods - Skype did this, the client has the public key of the server, it encrypts a random chunk of data and passes the public key (uniquely generated at install or at the start of every session) of the client to the server.· The server generates a chunk of it's own random data encrypts with the client's public key·and sends it back to the client.· Both the client and server hash the concatenated random data using an accepted cryptographic hash and the client replies to the server an encrypted ACK·using the hash result as the key.· If the server does not see the·ACK within the timeout, the link is reset.· If the client replies with a NACK, the link is reset.

    This way neither party can have full control of the key construction, so even if the same random data is sent from the client the final key will be different (and the server can be programmed to reject a random seed it suspects is compromised by resetting the link, disallowing a client's public key, disabling the account, etc...).· Once the link is established, a key exchange can be done over the secure link without the extra steps.

    -T

    Post Edited (GreyBox Tim) : 6/25/2010 7:08:18 AM GMT
  • DestructinatorDestructinator Posts: 34
    edited 2010-06-25 14:49
    Wow, so after what you all posted, My post feels a ltlle lame, cuz its just an update that Ive gotten the RJ45 connectors and have them connected to the breadboard and will start attempting the coding to try to get a basic system up and running to just prove how well it will work. then Im going to try and move on to multiple processors and make things more complicated. Im still running off of the EEPROM chip. I want to prove the concept of encrypting with the prop before I experiment more with mass storage such as MicroSD cards. Will keep you updated on my failures/successes. Keep on talking. The more I read and learn about encryption, the better my chances are for success.

    PS, Would anyone be intersted if I made this up in EagleCAD as a diagram? Also I can post a parts list from sparkfun as to all the extra bells and whistles.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2010-06-25 19:30
    Don't feel lame - that's the same way I started with this a while back.· Asking questions is what the forum is about.

    If you're looking to learn, take a look at this site: http://www.itl.nist.gov/fipspubs/by-num.htm

    AES = Pub 197

    Secure Hashing (SHA1 - SHA512) = Pub 180-3

    Keyed-(H)ash (M)essage (A)uthentication (C)ode (aka HMAC) = Pub 198-1

    Digital Signal Standard = Pub 186-3· <-- this is the one I recalled where they use a verion of public key cryptography for signature verification.


    And by all means, if you have an Eagle drawing put it up - there may be usefull comments, and it might spark an idea with someone who is even more "green" than you at this.· Also, before I sound discouraging - every security book I've ever read, and all the experts I've ever talked to all repeat the same basic rules:
    1. A security system should be scaled relative to the·danger of the subject being protected - i.e. you don't need a standing army and·laser-beams·attached to sharks, if you're protecting a cup of coffee... (a lid should do)
    2. A security system should not get in the way of the operation of what it is trying to protect (see failures in early HDMI/HDCP implementation as an example of a failure of this point, and more recently the BluRay release of Avatar and their DRM)
    3. A security system is not a permanent means of preventative action - but mearly a means of detection and delay, so that the appropriate response can occur before the attack is succesful (for example you would want a person to still be trying to break the window open when the police arrive)
    4. Though security systems can be perceived as a deterrent by many - it is NEVER to be expected to deter all attempts to circumvent it (look at any DRM system to date, and the lawer's reactions·for examples of failure here, however also look to the key updates with BluRay as a minor success).
    5. Layers,·the more security is required, the more layers of security a system should have.· The next layer inside the shell should be able to detect failures of the previous layer while delaying entry into itself by unauthorized persons.
    6. Maintenece - every day (not just when you feel like it).· If a key is compromized, re-key your locks.· If a lock-type is compromised, replace your locks.· If·personnel is compromised,·fire them (this means you may have to dis-allow clients that are no longer trusted).

    -T

    Post Edited (GreyBox Tim) : 6/25/2010 7:51:52 PM GMT
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2010-06-27 03:24
    GreyBox Tim said...

    Don't feel lame - that's the same way I started with this a while back.· Asking questions is what the forum is about.

    If you're looking to learn, take a look at this site: http://www.itl.nist.gov/fipspubs/by-num.htm

    AES = Pub 197

    Secure Hashing (SHA1 - SHA512) = Pub 180-3

    Keyed-(H)ash (M)essage (A)uthentication (C)ode (aka HMAC) = Pub 198-1

    Digital Signature Standard = Pub 186-3· <-- this is the one I recalled where they use a verion of public key cryptography for signature verification.


    And by all means, if you have an Eagle drawing put it up - there may be usefull comments, and it might spark an idea with someone who is even more "green" than you at this.· Also, before I sound discouraging - every security book I've ever read, and all the experts I've ever talked to all repeat the same basic rules:
    1. A security system should be scaled relative to the·danger of the subject being protected - i.e. you don't need a standing army and·laser-beams·attached to sharks, if you're protecting a cup of coffee... (a lid should do)
    2. A security system should not get in the way of the operation of what it is trying to protect (see failures in early HDMI/HDCP implementation as an example of a failure of this point, and more recently the BluRay release of Avatar and their DRM)
    3. A security system is not a permanent means of preventative action - but mearly a means of detection and delay, so that the appropriate response can occur before the attack is succesful (for example you would want a person to still be trying to break the window open when the police arrive)
    4. Though security systems can be perceived as a deterrent by many - it is NEVER to be expected to deter all attempts to circumvent it (look at any DRM system to date, and the lawer's reactions·for examples of failure here, however also look to the key updates with BluRay as a minor success).
    5. Layers,·the more security is required, the more layers of security a system should have.· The next layer inside the shell should be able to detect failures of the previous layer while delaying entry into itself by unauthorized persons.
    6. Maintenece - every day (not just when you feel like it).· If a key is compromized, re-key your locks.· If a lock-type is compromised, replace your locks.· If·personnel is compromised,·fire them (this means you may have to dis-allow clients that are no longer trusted).

    -T

  • DestructinatorDestructinator Posts: 34
    edited 2010-08-02 18:23
    Thanks greybox tim. That will help, right now Im getting ready to go off to college, so ive fallen behind in my projects. I am working however, to turn this into a PCB and get a working module. Ill have some time on the weekends with which to work on this. It is showing great potential to the world of hardware based cryptographics. I think that Ill also make a USB version so I can encrypt data being sent to a flash drive too, not just on a network connection.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Reach into a pocketful of dreams, now before they fall out of the seams" - Billy Talent, Pocketful of Dreams
Sign In or Register to comment.