http://www.facebook.com/editprofile.php#!/pages/Rahul-Bhati/231277413562366

Tuesday, August 4, 2009

code for cryptography :- Rahul Bhati

// ------------------------------------------------------------------------------------------------------------------------------------------------------// - -// - File: cencryptdecrypt.h. -// - -// - Contents: Implementation of class CEncryptDecrypt and a few helper functions. -// - -// - Purpose: TEA, XTEA and XXTEA crypto methods. -// - -// - Remarks: No restrictions and free to use open source. -// - -// - Originator: Michael Mogensen, MM-IT Consult 2003, michael-mogensen-danmark@hotmail.com. -// - -// - Compiler: MS Visual C++ 9.0. -// - -// - Period: 07.12.08 - 00.00.00. -// - -// - Version: 1.00. 07.12.08. Initial version. -// - 1.10. 18.12.08. Replaced MFC Array with SLT vector<> to loosen MFC dependence. -// - Added new Encrypt(...)/Decrypt(...) methods working with char*. -// - -// ------------------------------------------------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------------------------------------------------------------// - Miscellaneous. -// ------------------------------------------------------------------------------------------------------------------------------------------------------using namespace std;#pragma once
// ------------------------------------------------------------------------------------------------------------------------------------------------------// - Header(s). -// ------------------------------------------------------------------------------------------------------------------------------------------------------#include #include "strconv.h"
// ------------------------------------------------------------------------------------------------------------------------------------------------------// - Miscellaneous. -// ------------------------------------------------------------------------------------------------------------------------------------------------------inline const size_t GetSubString(const CString cstrSource, CString &cstrTarget, CONST UINT uPart2Lookup, const TCHAR cDelim)// Get substring no. uPart2Lookup of cstrSource and place it in cstrTarget. Substrings are separated by cDelim. Return length of substring.{ TRY { if(cstrSource.IsEmpty()) // No work to do. return 0; cstrTarget.Empty(); int iLoc_Begin = -1, iLoc_End = -1; if(uPart2Lookup == 0) { if(cstrSource[0] != cDelim) { iLoc_Begin = 0; iLoc_End = cstrSource.Find(cDelim, 1); } } else { for(UINT uPart = 0; uPart < iloc_begin =" cstrSource.Find(cDelim," iloc_end =" cstrSource.Find(cDelim," iloc_begin ="="" iloc_end ="="" iloc_end =" cstrSource.GetLength();" cstrtarget =" cstrSource.Mid(iLoc_Begin," cdelim =" TCHAR(''))//" n =" 3210" idigit =" ::_wtoi(CString(cstrlX[cstrlX.GetLength()" are ="="" iencryptdecryptstandard =" eTEA," ukey =" MAGIC_KEY)" m_iencryptdecryptstandard ="="" ullength =" (ULONG)cstrVal.GetLength();" ulid =" 0;" ullength =" 2L" ulid =" 0;" m_iencryptdecryptstandard ="=" ulid =" 0;" ulid =" 0;" ival =" (int)GetVec(0L);" chval =" (TCHAR)GetVec(0L);" m_iencryptdecryptstandard ="=" uid =" 0;" uid =" 0;" m_iencryptdecryptstandard ="=" uid =" 0;" uid =" 0;" uid =" 0;" cstrcommasepvalues =" cstrCommaSepValue;" chstop =" NULL;" uid =" 0;" cstrcommasepvalue =" ::GetSubString(cstrCommaSepValues," cstrcommasepvalue =" cstrCommaSepValue.Trim();" ulval =" ::wcstoul(cstrCommaSepValue," ulval ="=" ulval ="=" m_iencryptdecryptstandard =" iEncryptDecryptStandard;" ioffset =" 0)" ioffset =" 0)" href="http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm">http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm. { ULONG ulSum = 0; ULONG ulVec[SIZE_OF_VEC_TEA] = { GetVec(iOffset + 0), GetVec(iOffset + 1) }; for(register int iBit = 0; iBit <>> 5) + m_uKey[1]); ulVec[1] += ((ulVec[0] <<>> 5) + m_uKey[3]); } SetVec(iOffset + 0, ulVec[0]); SetVec(iOffset + 1, ulVec[1]); } inline const void TEADecrypt(const int iOffset) // Core decryption method (TEA) inspired from http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm. { ULONG ulSum = 0xc6ef3720; ULONG ulVec[SIZE_OF_VEC_TEA] = { GetVec(iOffset + 0), GetVec(iOffset + 1) }; for(register int iBit = 0; iBit <>> 5) + m_uKey[3]); ulVec[0] -= ((ulVec[1] <<>> 5) + m_uKey[1]); ulSum -= m_ulDelta; } SetVec(iOffset + 0, ulVec[0]); SetVec(iOffset + 1, ulVec[1]); } // ******************** // * XTEA. * // ******************** inline const void XTEAEncrypt(const int iOffset, CONST ULONG ulNumRounds = 32) // Core encryption method (XTEA) inspired from http://en.wikipedia.org/wiki/XTEA. { ULONG ulSum = 0L; ULONG ulVec[SIZE_OF_VEC_TEA] = { GetVec(iOffset + 0), GetVec(iOffset + 1) }; for(register ULONG ulRound = 0L; ulRound <>> 5)) + ulVec[1]) ^ (ulSum + m_uKey[ulSum & 3]); ulSum += m_ulDelta; ulVec[1] += (((ulVec[0] <<>> 5)) + ulVec[0]) ^ (ulSum + m_uKey[(ulSum >> 11) & 3]); } SetVec(iOffset + 0, ulVec[0]); SetVec(iOffset + 1, ulVec[1]); } inline const void XTEADecrypt(const int iOffset, CONST ULONG ulNumRounds = 32) // Core decryption method (XTEA) inspired from http://en.wikipedia.org/wiki/XTEA. { ULONG ulSum = m_ulDelta * ulNumRounds; ULONG ulVec[SIZE_OF_VEC_TEA] = { GetVec(iOffset + 0), GetVec(iOffset + 1) }; for(register ULONG ulRound = 0L; ulRound <>> 5)) + ulVec[0]) ^ (ulSum + m_uKey[(ulSum >> 11) & 3]); ulSum -= m_ulDelta; ulVec[0] -= (((ulVec[1] <<>> 5)) + ulVec[1]) ^ (ulSum + m_uKey[ulSum & 3]); } SetVec(iOffset + 0, ulVec[0]); SetVec(iOffset + 1, ulVec[1]); } // ******************** // * XXTEA. * // ******************** #define MX ((ulVecLast >> 5 ^ ulVecFirst <<>> 3 ^ ulVecLast << href="http://en.wikipedia.org/wiki/XXTEA">http://en.wikipedia.org/wiki/XXTEA { LONG lN = (LONG)GetVecSize(); ULONG *ulVec = new ULONG[lN]; ::memset(ulVec, 0, lN * sizeof(ULONG)); for(int iId = 0; iId < ule =" 0L," ulround =" 0L," ulsum =" 0L," ulveclast =" ulVec[lN" ulvecfirst =" ulVec[0];" lq =" 6"> 0) { ulSum += m_ulDelta; ulE = (ulSum >> 2) & 3; for(ulRound = 0L; ulRound < (ULONG)lN - 1L; ulRound++) { ulVecFirst = ulVec[ulRound + 1]; ulVecLast = ulVec[ulRound] += MX; } ulVecFirst = ulVec[0]; ulVecLast = ulVec[lN - 1] += MX; } // Copy from local vec. for(int iId = 0; iId < href="http://en.wikipedia.org/wiki/XXTEA">http://en.wikipedia.org/wiki/XXTEA { LONG lN = (LONG)GetVecSize(); ULONG *ulVec = new ULONG[lN]; ::memset(ulVec, 0, lN * sizeof(ULONG)); for(int iId = 0; iId < ule =" 0L," ulround =" 0L," ulsum =" 0L," ulveclast =" ulVec[lN" ulvecfirst =" ulVec[0];" lq =" 6" ulsum =" lQ" ule =" (ulSum">> 2) & 3; for(ulRound = (ULONG)lN - 1L; ulRound > 0L; ulRound--) { ulVecLast = ulVec[ulRound - 1]; ulVecFirst = ulVec[ulRound] -= MX; } ulVecLast = ulVec[lN - 1]; ulVecFirst = ulVec[0] -= MX; ulSum -= m_ulDelta; } // Copy from local vec. for(int iId = 0; iId < ulcoord =" m_ulvecEncrypt.at(uId);">::size_type stSize = m_ulvecEncrypt.size(); return stSize; } inline void SetVec(ULONG uId, ULONG ulVal) { m_ulvecEncrypt.at(uId) = ulVal; } private: // 0. Properties. (alphabetical). EEncryptDecryptStandard m_iEncryptDecryptStandard; CONST ULONG m_ulDelta; ULONG m_uKey[SIZE_OF_KEY]; vector m_ulvecEncrypt;};

Wednesday, February 25, 2009

new jobs links

Working in SingaporeComplete info on work opportunitiesin Singapore. Get free info now!www.home-in-singapore.sg
He Earns Rs 50000 Working1 Hr a Day From His Home Silently.Easy & Guaranteed Jobs. Quick Startwww.TurnPC2Cash.comDelhi
part time jobGet paid $1750-$7000 weekly. Parttime online jobs offered from home.www.cash-earners.com
JobsIndia's largest Jobs andRecruitment Search. Apply Now!www.TimesJobs.com
Earn 40000/Mon. Work@HomeSimply Sitting 1 Hr a Day. Earnthis Much? Hurry & Join Todaywww.way2netcash.com


Open FX account FREEAnd get Welcome Bonus 30 USDStart your Forex way herewww.instaforex.com


isTechie (you)Talk like a Jedi Master you do?Apply for a tech career at Directicareers.directi.com


Jobs New DelhiNew job listings daily.Find the latest jobs in Asia.asiajobsly.com


Sponsored Links

JobsNaukri.com 1000's Of Jobs For All Professions Apply Free! Get Interview Calls Now
Local Jobs in DelhiDelhi.Quikr.com/Jobs List openings or find the right job for you. Register for free!


Need a Better Job?MonsterIndia.com 1000s of New Jobs in India Submit Resume to Apply Naukri.com - Search Jobs in Delhi, Mumbai, Bangalore - Career - India
Search Jobs in India - Delhi, Mumbai, Bangalore, Kolkata. Find career openings in top companies. Post your resume and find your dream job Now !www.naukri.com/ - 111k - Cached -



Jobs in India, Search Online Jobs, Employment, Vacancy, Careers in ...
Jobs in India, Gulf and International - Search sales jobs, marketing jobs, IT jobs, part time jobs, finance jobs for fresher, executive and other levels.www.timesjobs.com/ - 72k - Cached - Similar





JobsAhead - Jobs in India,Bangalore,Mumbai,Delhi,Chennai,Kolkatta ...
Search for jobs in IT, marketing, software, finance. Includes company-wise job listings in India.www.jobsahead.com/ - 15k - Cached - Similar pages
Jobs in India, Jobs Employment - Vacancy - Placement India
Jobs in India, Jobs Search - Jobseeker - Job Seeker - Placement India Vacancy - Vacancies Job Employment opportunities vacancies in - Bangalore - Chennai ...www.clickjobs.com/ - 17k -

Jobs in India Indian job site India job site Jobs India
India's most comprehensive job site. Your job search ends here.www.careerindia.com/ - 41k -

Monster - Jobs in India,Delhi,Mumbai,Bangalore,IT Jobs,Sales Jobs ...
Find Jobs in India, Delhi, Bangalore, Mumbai, Chennai, Hyderabad. Apply For Jobs in IT,Sales, Call Center at Monster.com.www.monsterindia.com/ - 47k - Cached - Similar pages


Yahoo! India Job Search is the best place to find Jobs for Indians in India and abroad, from Job sites, Company job boards, Placement agency websites.in.jobs.yahoo.com/ - 37k - Cached -

BioPlanet Bioinformatics - Powered by XMB
The main board below is ONLY for bioinformatics related jobs. Please use the above link for all other jobs. Incorrectly posted jobs may be deleted, 408, 421 ...www.bioplanet.com/planetforums/forumdisplay.php?fid=1 - 82k - Cached - Similar pages
Jobs in India, Mumbai jobs, Delhi jobs, Bangalore jobs, Chennai ...
Jobs in India, Mumbai, Delhi, Bangalore, Chennai, Hyderabad, Pune from the web.www.bixee.com/ - 22k - Cached - Similar pages
Best Jobs India :: Indian job search, job bank, employment and ...
Jobs in India. Job and resume bank. Free job search by email. Free job advertising for employers.www.bestjobsindia.in/ - 31k - Cached - Similar pages