-
December 22nd, 2003, 03:27 AM
#1
abt encryption algorithm
hellooooo everyone here..
i hv sum qns.. i m doin prj recently.. so hence doin encryption on patient text files.. i m new to encryption.. so i m using xor encryption. i noe it is basic .. but it is easy to be decrypted by hackers.. right? so, i use xor encryption wif random xor-value.
is it ok?
okie.. here math algorithm..::::
srand(10); on top of the program -- // Init the random number generator with "10"...
i dun get it.. pls enlighten mi..
c=c ^ (rand()/12000 + 1);
u noe y 12000+ 1 is used? y nt 12000 or any numbers? any more to tell mi regardin tt.. feel free to tell mi.. i m willing to learn more..
that's all.. thanks. hope to hear frm u asap..
-
December 22nd, 2003, 06:37 AM
#2
You sure talk encrypted I'am having trouble decrypting your written language.
If your question was: Is the standard C's pseudo random generator (PRG) algorithm ok for cryptography, the answer is NO !!!
A few strange things with your scheme:
1. What type is your 'c' variable?
2. Why genereate a value between 0 and 12000?
3. srand()/rand() is probably implemented differently on different compilers or versions of compilers. This is a problem if you for instance re-build your app with a different or newer compiler and then want to decrypt old files.
4. Where is the encryption/decryption key???
5. The entropy of rand() it very low (maybe as low as 15 bits), thus very unsecure PRG for cryptography
If your program is running on Windows, use the MS Crypto API. It is not hard to use and there are several samples out on the net on how to use it.
If the data you're protecting isn't that sensitive, you may "invent" and use your own encryption scheme... but think twice before doing it...
Good luck.
-
March 7th, 2004, 02:12 AM
#3
Originally posted by j0nas
You sure talk encrypted I'am having trouble decrypting your written language.
If your question was: Is the standard C's pseudo random generator (PRG) algorithm ok for cryptography, the answer is NO !!!
A few strange things with your scheme:
1. What type is your 'c' variable?
2. Why genereate a value between 0 and 12000?
3. srand()/rand() is probably implemented differently on different compilers or versions of compilers. This is a problem if you for instance re-build your app with a different or newer compiler and then want to decrypt old files.
4. Where is the encryption/decryption key???
5. The entropy of rand() it very low (maybe as low as 15 bits), thus very unsecure PRG for cryptography
If your program is running on Windows, use the MS Crypto API. It is not hard to use and there are several samples out on the net on how to use it.
If the data you're protecting isn't that sensitive, you may "invent" and use your own encryption scheme... but think twice before doing it...
Good luck.
hey jonas.. soli for my so so late reply.. hahaha.. well, coz of probs logging in my reply last yr.. so, i forget abt tt..
hee.. i get wat u mean.. haHAHA. well, nvm abt tt.. coz, we used simple xor encryption with password needed in e end..
anywae thx for ur help.. [if u can see this]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|