Tauren -1 Junior Poster

How would I extract the public and private key and put them into seperate blobs? So after I use
if (!CryptGenKey(hProv, CALG_RC4, CRYPT_EXPORTABLE, &hSessionKey))

It puts the Keys into SessionKey, but what if I want to extract both the public and private key from hSessionKey, how can i do this?

Tauren -1 Junior Poster

bump for help

Tauren -1 Junior Poster
#pragma comment(lib, "crypt32.lib")

#include <stdio.h>
#include <windows.h>
#include <Wincrypt.h>
#include <iostream>
#define MY_ENCODING_TYPE  (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING)
//this is keylength bit shifted, here we have keylength of 1024bits hence 1024 << 16;
#define KEYLENGTH 0x04000000

using namespace std;
int main()
{
	DWORD dwFlags = 0;
	HCRYPTPROV m_hProv;
	PBYTE pbKeyBlob;
	DWORD dwKeyBlobLen;
	DWORD m_dwBlockSize;
	DWORD dwLen;
	DWORD m_dwKeySizeInBits = 50;
	HCRYPTKEY hPubKey;
	DWORD dwBlockSize = 250;

	// Ok this initialises the Crypto stuff, here im using the enhanced provider
	if (!CryptAcquireContext(&m_hProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, dwFlags))
	{
	   // If cant get default provider the following creates one
	   DWORD err = GetLastError();
	   INT iReturn = 0;
	   LPSTR pszContainerName = NULL;
	   DWORD cbContainerName = 0;

	   if(GetLastError() != NTE_BAD_KEYSET)
	   {
		   printf("Error opening default key container!\r\n");
	   }

	   // Create default key container.
	   if(!CryptAcquireContext(&m_hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET))
	   {
			printf("Error creating default key container!\n");
	   }

	   // Get size of the name of the default key container name.
	   if(CryptGetProvParam(m_hProv, PP_CONTAINER, NULL, &cbContainerName, 0))
	   {
		  // Allocate buffer to receive default key container name.
		  pszContainerName = (char *)malloc(cbContainerName);
		  if(pszContainerName)
		  {
			 // Get name of default key container name.
			if(!CryptGetProvParam(m_hProv, PP_CONTAINER, (BYTE *)pszContainerName, &cbContainerName, 0))
			{
				// Error getting default key container name.
				pszContainerName[0] = 0;
			 }
		  }
	   }

	   // printf("Create key container '%s'\n", pszContainerName ? pszContainerName : "");

	   // Free container name buffer (if created)
	   if(pszContainerName)
	   {
		   free(pszContainerName);
	   }
	}
	BOOL bResult = CryptGenKey(m_hProv, CALG_RSA_KEYX,  KEYLENGTH | CRYPT_EXPORTABLE, &hPubKey);
	if(!CryptExportKey(hPubKey, NULL, PUBLICKEYBLOB, 0, NULL, &dwKeyBlobLen))
	{
	   //deal with errors (wrong types, not set to be exportable etc)
	}
	if((pbKeyBlob …
Tauren -1 Junior Poster

No I need a Public/Private key, the method you stated wont be sufficient.

Tauren -1 Junior Poster

I am looking for a PKC library, I would like one that is decently fast. I have looked at RSA, but I cannot seem to find any decent libraries that would work. I will be encrypting packets that are sent out via UDP, however one client will have the private key and the other will have the public key, these keys will not be exchanged as they will be hard coded into the program.

Thanks.

Tauren -1 Junior Poster

When your in the game and you hit someone it would display damage up at top of screen.

For example: 4530 Crit!

How would you get it to display the text?

Tauren -1 Junior Poster

What is the diffrence between Software Engineering And Programming?

Tauren -1 Junior Poster

Do you think the C++ Programmer Primer is a good book and will teach me alot of information?

Tauren -1 Junior Poster

Greetings!

I just have a question is the book C++ Programming Primer By D.S. Malik a book worth getting?

What stage is it: Beginner, Professional
What does it teach me up to: What the last topics in book
Will I need more books after this regarding the topic?
And is there a Table of contents?

Tauren -1 Junior Poster

i++ Would be increased before code is done
++i is increased before code is done

Tauren -1 Junior Poster

I just dont fer what the statments do? whats the diffrence?

/code for (int i = 0; i < numItems; ++i)
what does that do like? lol explain

Tauren -1 Junior Poster

Ur right, If you had a server and maybe the data base which holds the items you wouldnt want the server holding the item before you got it I guess I will always just use i++

Tauren -1 Junior Poster
cout << "\nYou trade your sword for a battle axe.";
    inventory[0] = "battle axe";
    cout << "\nYour items:\n";
    for (int i = 0; i < numItems; ++i)
        cout << inventory[i] << endl;

Uhh well the question is that I really dont get the ++i Why would you use the pre fix instead of the post fix, I know how they work its just doesnt really make sense

Tauren -1 Junior Poster

So where can I find all the new visual c++ information like where I can learn to use new the newer c++

Tauren -1 Junior Poster

Uhh well, I was just wondering if C++ and visual C++ are any diffrent

Tauren -1 Junior Poster
Tauren -1 Junior Poster

So how do I learn DirectX 9.0 lol?

Tauren -1 Junior Poster

Ok sorry

What's a good book on game programming with DirectX 9.0

Tauren -1 Junior Poster
Tauren -1 Junior Poster

Yes but I dont know what is right to get?

Tauren -1 Junior Poster

Hello!

Does anyone know of any DirectX 9.0 Books for game programming if you can find any for me tell me please ty

Tauren -1 Junior Poster

lol those books are awesome!

Also, any Audio books for my game like when you into a area it starts playing that song

Tauren -1 Junior Poster

Do you know of any Audio Books That I can use for like the audio, say you just changed Zones A new song would start playing any books for like that?

Tauren -1 Junior Poster
Tauren -1 Junior Poster

Does anyone know any Winsock books I need them so I can learn about the functions and the coding about it. So if anyone has any books that They can post about that would help me out ty

Tauren -1 Junior Poster

A person ineed deserves books indeed! Umm any college like books we know of that I can get?? From C++ to the end! Maby not way end but enough to build a game!

Other post disregard Noones responded to it in the last 48 hours!

Tauren -1 Junior Poster

You might wanna use Arrays.

Tauren -1 Junior Poster

I want college books that are really good dont care about price! I just wanna learn!!!

Maby we could start off
with

thinking in c++ 1 and 2 get another book then get some AWESOME THE BEST c++ books around

Tauren -1 Junior Poster

Alright so can we get a run down of what books I should start with and what I should end with I would be so happy if you guys could do that! DANIWEB FTW

Tauren -1 Junior Poster

Any good books on networking in c++ With packets and stuff

Tauren -1 Junior Poster

Alrighty, ur in the game you click a NPC, you click to buy an item. It then sends a packet to the server seeing if you have enough money an so on if you do it sends a packet back? Would that be correct? If not can someone help me?

Tauren -1 Junior Poster

ty

Tauren -1 Junior Poster

So if you press .help in the c++ game it would say What do u need and when u do .kick it would tell you to type in a name when u type in .kick <name> it kicks the player and says player kicked

Tauren -1 Junior Poster

u know how in games for the admin commands you have like / or .(command)
would i have to do like if .wave do animation.wave?

Tauren -1 Junior Poster

Alright, lets get a rundown of what I think I should use for game Programming

1) Thinking in C++, Volume 1: Introduction to Standard C++ (2nd Edition)

2) Thinking in C++, Vol. 2: Practical Programming, Second Edition

3) Game Programming Gems 1-8

Alright, That what I am doing for that but now lets see here.... I wanna know if any one else has any Game coding books...

I need to know how to do Game programming like this:

bool ChatHandler::HandleHelpCommand(const char* args)
{
ChatCommand *table = getCommandTable();
WorldPacket data;
if(!*args)
return false;
char* cmd = strtok((char*)args, " ");
if(!cmd)
return false;
if(!ShowHelpForCommand(getCommandTable(), cmd))
{
FillSystemMessageData(&data, m_session, "There is no such command");
m_session->SendPacket( &data );
}
return true;
}

I wanna learn code like that for my game

Another Example...

#ifndef ENABLE_GRID_SYSTEM
m_positionX = m_destinationX;
m_positionY = m_destinationY;
m_positionZ = m_destinationZ;
#else
assert( m_destinationX != 0 && m_destinationZ != 0 && m_destinationY != 0);
MapManager::Instance().GetMap(m_mapId)->ObjectRelocation<Creature>(this, m_destinationX, m_destinationY, m_destinationZ, m_orientation); 
#endif
if(((uint32)m_positionX==respawn_cord[0])&&
((uint32)m_positionY==respawn_cord[1])&&
((uint32)m_positionZ==respawn_cord[2]))
SetUInt32Value(UNIT_FIELD_HEALTH,GetUInt32Value(UNIT_FIELD_MAXHEALTH));
m_destinationX = m_destinationY = m_destinationZ = 0;
m_timeMoved = 0;
m_timeToMove = 0;
}
else


Tauren -1 Junior Poster

Umm I am 15 and I spend almost 24 hours doing code. Coding is my life! Cout<< "My life";

Tauren -1 Junior Poster

Anthoer question....

If I wanna make a A header to say u would use it for the function

login to the game and then tell my server u did that would I have to make that header?
Actually how do u even make headerS?

Tauren -1 Junior Poster

Lol, I didnt understand any of that on the other hand, Joe is like you tell him 0x00014302 And hes like yeah I know that!

Good Job joe Keep it up!

Tauren -1 Junior Poster

Ok got it to work but now its asking me to find somewhere to excute it

Tauren -1 Junior Poster

I am using VC++...

I need to know how to add a header to the Application,
Can someone Joe, or anyone else Give me Step By step on how to do it...

Say I had a header called Bob.h

and I wanted to add it to my application Tauren

That needed it #include "b.h"

How would I add the Bob header to the application Tauren

If you dont understand what I said post...

Rember Step-By-Step I Am a noob you know!

Tauren -1 Junior Poster

Haha Just expressing my feelings that's all

Tauren -1 Junior Poster

Wow, I go into the AIM source coode (Legal) SDK is downloable on there site. And guess what I see! JAVA what noobs you know? Who uses java these days? Well hell it sure did'nt look like C++, but you never know?! Well if anyone thinks it was c++ give me a nice tell :cool:

jbennet commented: dont flame -1
Tauren -1 Junior Poster

Well, I checked google for the last day. You guys are better using that Medi-search engine then me. But, back on topic, I want to do graphics for the game Like the Roads, Characters, House, Dungeons! All the good stuff, if you could give me a place where I can go in the United States anywhere that would be great!


Thank you

Tauren -1 Junior Poster

Why thankyou joe! And colleges anyone know for art texturing!?

Tauren -1 Junior Poster

I have a question would the Particles in the game be any diffrent? Like in a game ur casting a spell or shooting a bullet you see the spell moving around in ur hand, or the bullets firing

http://www.wow-europe.com/shared/wow-com/images/features/classes/fr/mage.jpg

hes casting a spell how would I do that in a game? Model it?

Tauren -1 Junior Poster

Lol any help or is this just a failing post.

Tauren -1 Junior Poster

help

Tauren -1 Junior Poster

Dear S11kenneth, I just wanted to let you know that you need to be a little mroe Specific about what you wanna do. If you do not explain what you want to exactly do we will have a hard time understanding.


2 lines wont cut what you want to exactly do make a mmorpg?

Tauren -1 Junior Poster

Dear Daniweb friends,

I need a well, friendly, and Educating college. I wanna do Art.
For example I have to relate this to World of Warcraft because they inspired me!

Website Link http://www.worldofwarcraft.com/insider/04/images/mage.jpg
(World of Warcraft Main website owned by Blizzard Entertainment)

Do you see how he is casting the Spell? Well, Thats What I wanna do I wanna make the characters for my MMORPG I also wanna do the spells I dont know how you would do spells its like some particles,
I Would want A college close to me in New York, where I can learn and be Theroly taught how to Build, Texture Edit Do the spell casting stuff and learn more! If you can help me please post I would be very thank full for your help Daniweb!

Untill Next post Enjoy your stay at Daniweb.com

Your Friend, Tauren!

Tauren -1 Junior Poster

lol 98