encryption algorithm like simple DES or DES

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

Does anyone know how to code in Assembly Language to make encryption algorithm like simple DES or DES.

I'm using ATmega8535 or ATmega32 with Atmel studio 6.2

Thanks

 

*Split and re-titled. Moderator*

Last Edited: Wed. Feb 1, 2017 - 02:17 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does app note AVR230 help?

http://www.atmel.com/images/doc2...

 

[I think you should have started a separate thread.]

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to the Forum.

 

Perhaps a Moderator will split this off into its own Thread.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simple encryption algorithm? I don't think there is such a thing.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, there are plenty of very simple encryption algorithms - the trouble is, they are also very easy to break.

 

I certainly don't think that DES would count as "simple"...

 

surprise

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tiska hardiana wrote:
Does anyone know how to code in Assembly Language to make encryption algorithm like simple DES or DES.
Not quite the answer you want but here goes.

Last month (Oct 2015), Atmel released their crypto library of C source code for Atmel crypto devices such as the ATECC508A.

These crypto devices are much faster than a non-XMEGA (most) AVR in cryptographic operations.

There's now stock of ATECC508A which is a part of the recently in-stock Arduino new WiFi board.

ATECC508A is a 2V to 5V part but the library is currently for :

  • SAMD21 on Atmel Studio and ASF or START.
  • Microsoft Visual Studio and Microsoft Windows HID.
  • Linux, USB CDC.

Atmel states that more computer architectures and development environments are forthcoming.

The library's application note states there's a HAL and how to port the HAL.

Atmel Corporation

Home > Products > Security ICs > Atmel CryptoAuthentication > ECC-based Devices

CryptoAuthLib

http://www.atmel.com/tools/CryptoAuthLib.aspx?tab=documents

...

CryptoAuthLib: Driver Support for Atmel CryptoAuthentication Devices
(file size: 830KB, 22 pages, revision A, updated: 10/2015)

Covers how to get started, how to incorporate into an application, general design and use patterns, and the integration details required if CryptoAuthLib is to be ported into a hardware platform not currently supported by CryptoAuthLib.

...

Atmel Corporation

Home > Products > Security ICs > Atmel CryptoAuthentication

CryptoAuthLib

http://www.atmel.com/tools/CryptoAuthLib.aspx

Edit : added library's URL.


Arduino WiFi Shield 101

https://www.arduino.cc/en/Main/ArduinoWiFiShield101

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. Nov 3, 2015 - 12:36 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Microchip have an AES128 library written in assembler for a their pic16. It should be a simple matter to translate that to AVR asm. For the most part it is just moving bytes around, doing shifts and xors.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Microchip have an AES128 library written in assembler for a their pic16. It should be a simple matter to translate that to AVR asm. For the most part it is just moving bytes around, doing shifts and xors.
 

 

Piece of cake

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note, also, that the Xmega A series have an internal hardware module for encryption / decryption.

 

Using this might be faster and easier than a software only solution, or adding the external chip.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also XMEGA B and the largest XMEGA C.

For the following URLs, select "Cryptography" from the "Category" pull-down menu :

http://asf.atmel.com/docs/latest/search.html?device=xmegaau (Please note the examples for Atmel's XMEGA A3BU board)

http://asf.atmel.com/docs/latest/search.html?device=xmegab
http://asf.atmel.com/docs/latest/search.html?device=xmegac

http://www.atmel.com/tools/XMEGA-A3BUXPLAINED.aspx

Edit : added AU URLs.

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. Nov 3, 2015 - 08:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Microchip have an AES128 library written in assembler for a their pic16. It should be a simple matter to translate that to AVR asm. For the most part it is just moving bytes around, doing shifts and xors.

 

Wouldn't it be easier to just use the one that already exists for AVR?

 

http://www.das-labor.org/wiki/AVR-Crypto-Lib/en

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The op wants asm.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's an asm implementation in there...for aes, I mean.

Last Edited: Tue. Nov 3, 2015 - 09:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i would like to cut over cryptoauthlib to windows,the compiler is microsoft visual studio 2010,the chip is ATSHA204A;

Does the chip ATSHA204A support an interface of USB? 

if not,then what i can do to talk to ATSHA204A?

uzslm

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not really sure what you're intending to do, but since you're talking about a chip that has built in sha-256 support it's a mystery to me why you'd resurrect a year old thread about implementing encryption algorithms in general purpose microcontrollers.  Your questions can all be answered by a quick glance at the datasheet.  It does not support USB, and you talk to it via single wire uart or i2c.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the information!
my MCU is PIC16F with USB interface,from microchip;

then,i would like to talk to ATSHA204A via i2c with my PIC,then copy the data from I2c to windows hots program via USB;

i plan to implement encryption there on the host windows PC.

now the problem is,how could i port Cryptoauthlib to visual studio 2010?

uzslm

Last Edited: Tue. Jan 31, 2017 - 11:36 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uzslm wrote:
i would like to cut over cryptoauthlib to windows,the compiler is microsoft visual studio 2010,the chip is ATSHA204A;
CryptoAuthLib for ATSHA204A has a Windows implementation (Visual Studio) via USB HID or USB CDC and a Linux implementation via USB CDC or UART.

uzslm wrote:
Does the chip ATSHA204A support an interface of USB?
No; it's SWI or TWI.

uzslm wrote:
if not,then what i can do to talk to ATSHA204A?

  • USB bridge via AVR with a USB device controller (AVR TWI to USB device)
  • USB bridge non-AVR (USB device to I2C)
  • Low Pin Count (LPC) bus on the PC

If the PC has a TPM connector then that might work (I don't know the Trusted Platform Module (TPM) physical interface)

 


http://www.atmel.com/tools/CryptoAuthLib.aspx

http://www.atmel.com/devices/ATSHA204A.aspx

http://www.atmel.com/tools/AT88CK590.aspx

http://www.microchipdirect.com/productsearch.aspx?Keywords=AT88CK590

 

Edit : microchipDIRECT

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. Jan 31, 2017 - 04:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uzslm wrote:
now the problem is,how could i port Cryptoauthlib to visual studio 2010?
Might be good to go as CryptoAuthLib is already on Visual Studio; what's uncertain is the differences in versions of Visual Studio.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

in fact i tried compiling the lib on VS2010,but even the key word "bool" could not be recognized by the compiler;

when i read through some source files,only found that the header files included,such as:

#include <stddef.h>

#include <stdlib.h>

#include <string.h>

and: #pragma pack( push, ATCAPacket, 2 )

i think they are platform dependent;maybe typically for ATMEL AVR or ARM platform.

 

visual studio also have  <stddef.h>,<stdlib.h>, <string.h>,but i am not sure if it will be the same as that of atmel studio;

 

the file "atca_compiler.h" includes one single line:

 

#elif defined(_MSC_VER)
/* Microsoft Visual Studio. --------------------------------- */

 

but i could not find any further compiler switching lines elsewhere in the files of the lib to Immigrate to another compilers (like VC++);

So i just want to know if microchip or atmel could have any document or information to guide how to Immigrate.
 
Any information will be appreciated.
Thanks in advance!
uzslm 

uzslm

Last Edited: Wed. Feb 1, 2017 - 01:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uzslm wrote:
my MCU is PIC16F with USB interface,from microchip;

While Microchip is the parent company of Atmel, this is still an AVR specific site so I would suggest you ask your PIC questions in the PIC forums.

 

As far as the Security questions go there is a forum in the IoT community.

 

I'll move this thread there you might get better answers

 

JIm-Moderator

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

in fact implementing Cryptoauthlib on windows platform is my concern...

i did send information about this before posting here...

 

 

uzslm

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
Might be good to go as CryptoAuthLib is already on Visual Studio; what's uncertain is the differences in versions of Visual Studio.

 

If possible, please kindly advise which version of  Visual Studio will be appropriate to CryptoAuthLib;

i believe CryptoAuthLib took advantage of C99,but VS2010 didn't support that,so possible VS version could be 2013,or 2015,so i want to know under which version CryptoAuthLib was compiled by ATMEL,VS2013 or VS2015?

uzslm

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Am unsuccessful in the search for the answer.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will try VS2013...C99 was supported by microsoft since VS2013,although not totally

uzslm

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

VS2013 does not work,

anonymous union was not supported...i have to try VS2015

uzslm