Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / encryption program

Author
Message
Mizipzor
20
Years of Service
User Offline
Joined: 24th May 2004
Location: Sweden
Posted: 12th Jun 2004 18:07
im writing a little program to encrypt text:



i need help to make so that if i press space there is a space in the encrypted message. also suggestions on improvements, i feel that this could be written with slightly less variables.

oh, you also need a key.txt, put this on a single line in it:

qwertyuiopasdfghjklzxcvbnmaaa

thats how my encrypted alphabet is.

thanks

Dreaming of creating a highly advanced AI mind
Mizipzor
20
Years of Service
User Offline
Joined: 24th May 2004
Location: Sweden
Posted: 12th Jun 2004 18:50
ive made a solution, it handles spaces and erasing now, it also makes files of it when you exit.



however, i think ive done it in the worst kind of way. the entry() way of doing it wasnt as good as i hoped for, all characters typed arent processed and stuff like that. also backspace only seems to erase from one strin. and when you exit, it only makes one of the string to a file.

this program is completely bugged help me out please.

thanks

Dreaming of creating a highly advanced AI mind
Mizipzor
20
Years of Service
User Offline
Joined: 24th May 2004
Location: Sweden
Posted: 12th Jun 2004 21:26
almost nothing works... except that it converts my typing into encrypted text. the erasing is buggy. but hey it works for for now .



But it simply refuses to make that file of the excrypted text for me! could someone help me out please? just make .txt file in the same directory with a single line:

qwertyuiopasdfghjklzxcvbnmaaa

And why am i getting no responses? Doesnt anyone in here like encryption?

thanks anyway

Dreaming of creating a highly advanced AI mind
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Jun 2004 00:07
I would suggest that you allow the text to be entered, and then encrypt it. Encrypting as you key does nothing for you code except make it more complex than it needs to be.

The reason that the file won't update with your new text is that the OPEN TO WRITE command will not open a file that already exists. Use the DELETE FILE command first, then open the file.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Mizipzor
20
Years of Service
User Offline
Joined: 24th May 2004
Location: Sweden
Posted: 13th Jun 2004 04:18
i tried to make it that way before. the program reads from a file input.txt and encrypt it all. but for some reason the program shut down if the input file was to long! i did never figure out why... maybe you can?



that way everything would be so much easier. please solve this one as it did reeeally puzzle me

thanks anyway
cheers and goodnight (night for me at least )

Dreaming of creating a highly advanced AI mind
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Jun 2004 04:28
dbp file commands are absolute horsesh*t...

free yourself by clicking the logo below.
enough of this madness


* DBP_NETLIB_v1.2 - NOW WITH VARIABLE WATCHER! * Click Logo
Mizipzor
20
Years of Service
User Offline
Joined: 24th May 2004
Location: Sweden
Posted: 14th Jun 2004 14:11
which logo?

you do some custom dll's? ill be glad to explore the file handling part. but i dont seem to find any link...

Dreaming of creating a highly advanced AI mind
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Jun 2004 15:23
Well, do you see that large purple graphic with with words 'Plugins for Dark Basic Professional' on it? ...

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Mizipzor
20
Years of Service
User Offline
Joined: 24th May 2004
Location: Sweden
Posted: 14th Jun 2004 15:35
nope

i thought he included an image link to the site in his sig... but i cant see it. couldnt you just post the link here directly cattlerustler?

Dreaming of creating a highly advanced AI mind
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 15th Jun 2004 01:44 Edited at: 15th Jun 2004 01:45
@ CattleRustler
Some people browse with sig images turned off. You should edit your profile and add the webaddress so the link appears as the Web button under each of your posts.

@ mizipzor

In dbpro I think you can only read strings upto 255 characters long. Longer strings just cause it to exit with no error message.
To get arround that just read the file a byte at a time with READ BYTE and use it to make a string.

can i scream
Mizipzor
20
Years of Service
User Offline
Joined: 24th May 2004
Location: Sweden
Posted: 15th Jun 2004 02:14
@the_winch

sounds logical, but how do i find out how long the text is? so i know how many times i need to run READ BYTE? and how do i puzzle the results together to a single string?

could you please write me a little snippet or kick me in the direction of a good tutorial / already existing snippet?

thanks
mizi

Dreaming of creating a highly advanced AI mind
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 15th Jun 2004 02:53 Edited at: 15th Jun 2004 02:57
Here is a quick example.



read_string() Reads up until the end of the file or a line end(chr$(13)+chr$(10)) and puts it in a string.

write_string() writes the string a byte at a time then writes a line end.

can i scream
Mizipzor
20
Years of Service
User Offline
Joined: 24th May 2004
Location: Sweden
Posted: 15th Jun 2004 12:59
ok... but what if a single line is longer than 255 characters? then the string would be flooded. or as it is now, the program supports only three lines, is there any way to read how many lines a file has? then i would make a string array with the number of elements set to the amount of lines the textfile had.

Dreaming of creating a highly advanced AI mind

Login to post a reply

Server time is: 2024-11-26 21:23:24
Your offset time is: 2024-11-26 21:23:24