1. File Encrypter

I built a file encrypter from scratch but the decoder can't seem to read
the Multipliers.
include get.e
include misc.e
include machine.e
include database.e

atom db1, db2, mem, db3, plex, div
db1 = db_open("user.dat", DB_LOCK_NO)
db2 = db_select_table("mem")
// Memory available for get_bytes()
mem = db_record_data(1)
db3 = db_select_table("user")
plex = db_record_data(1)
div = db_record_data(2)


atom openf, new
sequence file, getb, out
file = prompt_string("File to Decode: ")
openf = open(file, "r")
getb = get_bytes(file, mem)
out = getb / plex * div
new = open("out.txt", "w")
puts(new, out)

This program may have a couple of bugs, I left the copy in the car.
but the encoder reads the file, the multiplies the ASCII characters then
stores the multipliers in the database for use by the decoder. I have only 
used EUphoria for about 1/2 year.

new topic     » topic index » view message » categorize

2. Re: File Encrypter

you want to use binary mode when reading in the file 
open(file,"rb")

how are you storing the sequence of bytes? puts or print?

you might use the bget.e lib to store your sequences



Tristen Wilson wrote:
> 
> I built a file encrypter from scratch but the decoder can't seem to read
> the Multipliers.
> }}}
<eucode>
> include get.e
> include misc.e
> include machine.e
> include database.e
> 
> atom db1, db2, mem, db3, plex, div
> db1 = db_open("user.dat", DB_LOCK_NO)
> db2 = db_select_table("mem")
> // Memory available for get_bytes()
> mem = db_record_data(1)
> db3 = db_select_table("user")
> plex = db_record_data(1)
> div = db_record_data(2)
> 
> 
> atom openf, new
> sequence file, getb, out
> file = prompt_string("File to Decode: ")
> openf = open(file, "r")
> getb = get_bytes(file, mem)
> out = getb / plex * div
> new = open("out.txt", "w")
> puts(new, out)
> </eucode>
{{{

> This program may have a couple of bugs, I left the copy in the car.
> but the encoder reads the file, the multiplies the ASCII characters then
> stores the multipliers in the database for use by the decoder. I have only 
> used EUphoria for about 1/2 year.
you might look at using bget.e lib to store and put your data objects





--"ask about our layaway plan".
--

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu