-
August 16th, 2003, 06:47 PM
#1
HELP! Need help to understand these codes! ..(BYTE)(....
char m_cTestChar;
for(int m_iCountString=0;m_iCountString<m_iNumberOfTextLongBlock;m_iCountString++)
{
for(int m_iCount4Long=3;m_iCount4Long>=0;m_iCount4Long--)
{
m_cTestChar=(BYTE)(m_lEcrpTeksArry.GetAt(m_iCountString)>>(m_iCount4Long*8));
if(m_cTestChar==0)
{
BilZero++;
m_sEncryTea+="#";
m_iKor=(BYTE)((m_iCountString*4)+(3-m_iCount4Long));
m_sEncryTea="END"+m_sEncryTea;
m_sEncryTea=m_iKor+m_sEncryTea;
m_sEncryTea="ZERO"+m_sEncryTea;
if(BilZero>20)
{
AfxMessageBox("The Encryption Key is Not Suitable, please choose another one!");
return;
}
}
else
m_sEncryTea+=(BYTE)(m_lEcrpTeksArry.GetAt(m_iCountString)>>(m_iCount4Long*8));
hello...i really need to know what the codes about works...!!
Especially this :
m_cTestChar=(BYTE)(m_lEcrpTeksArry.GetAt(m_iCountString)>>(m_iCount4Long*8));
for ur information.. i'd converted a set of strings into LONG blocks.. then encrypted them using TEA Algoritm.. and now..this part.. a friend of mine e-mailed me.. its for "CONVERTING THE EXCRYPTED TEXTS INTO STRING"...
I'm sorry i really need u guys to help me understand these codes..as my friend also dunno how it works..
Thanks in advance.
Regards,
Thong
twh81@tm.net.my
..to have the most amazing dream...
-
August 16th, 2003, 09:27 PM
#2
The line retrieves the value stored in the index m_iCountString in the member array m_lEcrpTeksArry (an encryption key, I assume) and extracts a byte from it. Notice that, due to the way m_iCount4Long is used, I can assume that the code given reads a long value, MSB (most significant byte) first.
If 20 zero-bytes appear in the key, it is considered invalid.
-
August 17th, 2003, 01:53 PM
#3
This is just because expression on right returns value something larger than BYTE/char. You can safely remove (in given case) and it will work fine except compiler warinings!
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
|