Alexander
i joined Gateway users to try and find help for my wireless its a t6330u i tried several times to send you a message asking about this but the forum wont let
says i need more posts in order to send a message
Alexander
i joined Gateway users to try and find help for my wireless its a t6330u i tried several times to send you a message asking about this but the forum wont let
says i need more posts in order to send a message
xoxo
jes
that is not my code,i got it from one of website,does it mean that code is just dummy code...?it is posted there but isn't usable...i'm trying to make des encryption in c or c++(that able to execute,at least)...any help would be appreciated .TQ
もう誰かのためじゃなくて 自分のために笑っていいよ
~ Please do mark as resolved thread if your problem is solved,thanks~
Alexender - what C code have you written allready ? (The reason I ask is that the need for a main() is requirement for ALL C programs, and it is C language 101 - if you are struggling with the concept then you should go back and re-read your c programming books/tutorials/lessons - and start with something easier).
In your specific case :
your des.c and des.h together define two public functions :
These functions will need to be called, by you, before they work.Code:void EncryptDES(bool key[56], bool outBlk[64], bool inBlk[64], int verbose); void DecryptDES(bool key[56], bool outBlk[64], bool inBlk[64], int verbose);
What you will to do is to write a 2nd .c file (your application) which includes a main() function, and which calls the EncryptDES and DecryptDES functions appropriately (it will probably do a lot else as well).
assuming you have created your des.o file as follows :
des.o is a object module - you can link other things to it, but not run it.Code:gcc -c des.c -o des
If you have called your application source code file main.c - then you will be able to build your application by compiling :
This compiles main.c and links it to des.o and creates an executable (in your current directory) called application.Code:gcc main.c des.o -o application
and then run it via
NOte : My primary language is Python and the gcc commands above maybe incorrect - if they are i apologise and i am sure other in this forum will provide corrections as neccessaryCode:./application
Tony - Happy to try to help.
Unless otherwise stated - all code posted by me is untested. Remember to Mark the Thread as Solved.
Ubuntu user number # 24044 Projects : TimeWarp - on the fly Backups
i know that every c script needs main() to run...but because that website doesn't provide any of it....i ask here if there any way to run the code without main (without error)....i frequently use whatever.h as header file,but i admit i never call public function from other file and use it in other file....(i do that only in JAVA)..tq for noted me that i'm need to do that.thank you
もう誰かのためじゃなくて 自分のために笑っていいよ
~ Please do mark as resolved thread if your problem is solved,thanks~
There is no way to call this DES functions w/o a main() function. Similarly in Java, a "public static main()" function is required.
I will cheerfully develop the main() function for you if you would be so kind as to provide documentation as to how the two DES functions should be used.
I need to know the specifics as to what data should be placed in each of the arrays that the functions require.
もう誰かのためじゃなくて 自分のために笑っていいよ
~ Please do mark as resolved thread if your problem is solved,thanks~
Bookmarks