Appendix a, Tiny encryption algorithm – Alloy Computer Products Network Device BWS-136 User Manual

Page 17

Advertising
background image

BWS-136 User Manual_amend.doc

- 33 -

Echo Syntax

After BWS-136 console port received correct command string, it

will response Echo String and the Echo Syntax is as follow:

[Delimiter][Function][Status]

Delimiter (One byte): A percentage sign “%”

Function (Two bytes): function string

Status: “OK” or “FAIL”

For example: Set the IP Address by sending command

$SLI192.168.16.100(CR)(LF)

Echo string

%SLIOK(CR)(LF)

means the new IP address is successfully transferred to the module

and the new setting will be effective after reboot the module.

To get IP address setting, you can send a command as follow

$GLI

then the Echo string will be

%GLI192.168.16.100

Always remember to reboot the module by send command

$SYCR to use the new configuration

BWS-136 User Manual_amend.doc

- 34 -

Appendix A

Tiny Encryption Algorithm

1. Example of TEA.C

/************************************************

The Tiny Encryption Algorithm (TEA) by David Wheeler and Roger Needham of the

Cambridge Computer Laboratory. Placed in the Public Domain by

David Wheeler and Roger Needham.

**** ANSI C VERSION (New Variant) ****

Notes:TEA is a Feistel cipher with XOR and addition as the non-linear mixing

functions.

Takes 64 bits of data in v[0] and v[1]. Returns 64 bits of data in w[0] and w[1].

Takes 128 bits of key in k[0] - k[3].

TEA can be operated in any of the modes of DES. Cipher Block Chaining is, for

example, simple to implement. n is the number of iterations. 32 is ample,

16 is sufficient, as few as eight may be OK. The algorithm achieves good

dispersion after six iterations. The iteration count can be made variable if

required.

Note this is optimised for 32-bit CPUs with fast shift capabilities. It can very

easily be ported to assembly language on most CPUs. delta is chosen to be the

real part of (the golden ratio Sqrt(5/4) - 1/2 ~ 0.618034 multiplied by 2^32).

This version has been amended to foil two weaknesses identified by David A.

Wagner ([email protected]): 1) effective key length of old-variant TEA was

126 not 128 bits 2) a related key attack was possible

Advertising