English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 02 January 2023, 23:57   #1
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
How to do file encryption using poke and peek?

Hey guys,

I want to encrypt my files where it cannot be viewed or modified outside the program. I want the program to be able to decrypt the file, get's values, display them on the screen. When the person modifies the values it saves them back into the file and do encryption again. I want to do a 16 bit encryption. I am coding in AmiBlitz of course. Any advise how to do that would be greatly appreciate it.

I prefer using Poke and Peek to do this if possible.
xboxown is offline  
Old 03 January 2023, 12:48   #2
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
This is not a trivial topic; Amiga is a shared-memory architecture so if you decrypt the file in-memory then any other program running would also be able to view the contents. How secure do you want it to be? A simple way would be to XOR the 16-bit values with some secret key. A complex way would be to implement RSA public-private key security or something similar.
E-Penguin is online now  
Old 03 January 2023, 22:13   #3
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by E-Penguin View Post
This is not a trivial topic; Amiga is a shared-memory architecture so if you decrypt the file in-memory then any other program running would also be able to view the contents. How secure do you want it to be? A simple way would be to XOR the 16-bit values with some secret key. A complex way would be to implement RSA public-private key security or something similar.
Can you teach me or show me example code of the simple way would be xor the 16 bit values with some secret keys?
xboxown is offline  
Old 04 January 2023, 05:07   #4
Dan
Registered User
 
Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 629
Here is an example code in BlitzBasic for the PC.
Dan is offline  
Old 04 January 2023, 15:35   #5
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
Once you have got XOR'ing working, you can add a stream cypher to generate a more pseudo-random output. RC4 is "broken" in that it's no longer considered secure enough for real use, but it is simple and could be implemented on the Amiga without much effort. It's certainly more secure than XOR with a static key alone.

https://en.wikipedia.org/wiki/RC4
E-Penguin is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Poke BPLxMOD after WAIT in Copperlist KONEY Coders. Asm / Hardware 2 18 November 2020 14:00
Blitz Basic 2 & Peek Retro1234 Coders. Language 11 28 February 2016 19:34
anyone got an Atari ST they can peek inside? Interceptor support.Hardware 29 17 April 2015 15:29
AES-256 ECB file encryption tool for classic Amiga modrobert Coders. Releases 44 24 March 2015 14:23
Winuae Poke commands macca72 support.WinUAE 6 04 July 2010 19:31

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:11.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06958 seconds with 15 queries