Posted by kpyro on 00:07:00 02-06-2002
I know that you can just go to MSDN but it isn't very organized, I want something that is just like a dictionary. Something that goes through each command one by one. Also, I am loooking into building an encryption program so I decided to download a few to see where the heck I would start. But there was one I downloaded but there was a command I was confused by... it was combining two variables; Something like this:
strBuff = c and &HFF
What the heck is &hff? Thanks for the help.
Posted by IbYdI on 12:19:00 02-06-2002
its 255 only its in hex
Posted by kpyro on 18:44:00 02-06-2002
Ok, thanks; but why would they want to combine 255 in hex with a character??
Posted by IbYdI on 19:18:00 02-06-2002
can't answer that question w/o seening the code.
but hexadecimal (just like decima, octal, binary, only its based on 16 digits) is just a way of writing numbers, so the question is : why would they want to combine 255 with a character.
[ This Message was edited by: IbYdI on 2002-02-06 19:21 ]
Posted by kpyro on 01:18:00 02-07-2002
Ok, here is the code:
strBuff = strBuff & chr$(c AND &HFF)
If you need more just reply and I will post more. But basically the code before it is taking an ASCII character and encrypting it by password, then taking each letter of the password and manipulating it.
Posted by dxprog on 02:26:00 02-07-2002
kpyro: I made my own encryption program at one time. If you want it I can send it to you. If you want a list of commands use the MSDN Library CDs that came with VisualBasic.
Posted by IbYdI on 06:44:00 02-07-2002
a few more lines would be of help if you want me to explain them in total.
but i think it should be pretty clear if you think what an encryption algo is.
Posted by inhahe on 20:11:00 09-21-2003
Quote:
On 2002-02-07 01:18, kpyro wrote:
Ok, here is the code:
strBuff = strBuff & chr$(c AND &HFF)
If you need more just reply and I will post more. But basically the code before it is taking an ASCII character and encrypting it by password, then taking each letter of the password and manipulating it.
c and &HFF is just extracting the lower byte of c and ignoring the rest. it's the same as saying c mod 256.
it could take a lot to explain what's going on there.. but in short
1 and 0 = 0
0 and 1 = 0
0 and 0 = 0
1 and 1 = 1
therefore,
in binary,
say c = 10011010101110100101100101101010
&HFF = 00000000000000000000000011111111
c and 255 = 00000000000000000000000001101010
it's like truncating a long (or maybe it's an integer, which would be 16 bits) into a byte.
chr$() won't accept any value over 255.
[ This Message was edited by: inhahe on 2003-09-21 20:12 ]