I use a pass phrase that is entered by the user which then is converted to base64. Then the password input is converted aswell and combined with the salted password. That string is then encrypted with aes256 and a key size of 256. And returned back as a base64 string. I want to keep this level of security while shortening the end result.
I don't know how many of you remember Sauerbraten (cube 2) but there was a mod made called Tesseract that adds dynamic lighting (no more having to calculate lights after edits).
The project files can be downloaded from [url]http://tesseract.gg/[/url]
My issue is that the menus and main interface don't load. The console can be opened and used but all UI commands are invalid.
[QUOTE=QuikKill;41519174]I use a pass phrase that is entered by the user which then is converted to base64. Then the password input is converted aswell and combined with the salted password. That string is then encrypted with aes256 and a key size of 256. And returned back as a base64 string. I want to keep this level of security while shortening the end result.[/QUOTE]
So you have base64(aes256(key, base64(passphrase) + base64(password) + salt))? What's with all the base64?
[QUOTE=Aathma;41519817]I don't know how many of you remember Sauerbraten (cube 2) but there was a mod made called Tesseract that adds dynamic lighting (no more having to calculate lights after edits).
The project files can be downloaded from [url]http://tesseract.gg/[/url]
My issue is that the menus and main interface don't load. The console can be opened and used but all UI commands are invalid.[/QUOTE]
Is this a bug report?
[QUOTE=ZeekyHBomb;41519951]Is this a bug report?[/QUOTE]
No... I'm assuming I set something up wrong. Looking around it seems that the file collection isn't standalone and is missing some docs from the original Cube-2
[quote=rev200]remove old 3dgui stuff and put in broken/work-in-progress new-new-ui[/quote]
Maybe something with this. You could try reverting to rev199 or asking on their IRC.
[QUOTE=ZeekyHBomb;41519951]So you have base64(aes256(key, base64(passphrase) + base64(password) + salt))? What's with all the base64??[/QUOTE]
Perhaps I worded it incorrectly.
encryption = (aes256(hash(base64(passphrase + salt)))
password = encryption(password)
That's pretty close.
Guys, for the love of god why is it so hard to read from an already existing database in android?
what's wrong with calling this:
SQLiteDataBase db = SQLiteDatabase.openDatabase("Personalities.db", null, SQLiteDatabase.OPEN_READWRITE);
All I need to do is read a few simple values from 4 very simple tables. What is the easiest way to do this?
[QUOTE=QuikKill;41520490]Perhaps I worded it incorrectly.
encryption = (aes256(hash(base64(passphrase + salt)))
password = encryption(password)
That's pretty close.[/QUOTE]
You mean
key = hash(base64(passphrase + salt))
password' = aes256(key, password)?
I don't think that base64 before hashing does any good.
Anyway, password' should at most only be a couple of bytes longer than password. Like ThePuska said, rounded to the next 16 bytes, so at most 15 bytes more.
If you print that as a hexadecimal number that'd be at most 30 digits more (also repeating ThePuska here). As more or less human readable base64 that'd be 20 characters.
You could use a weaker cipher like Blowfish, which has half the block size so at most 7 bytes (14 hex digits/10 base64 chars) more, but otherwise I can't think of a way to reduce the "padding".
Speaking of the smart pointers mentioned in the last page, I need some pointers (pun intended :v:) on what I should use for my entity system. First off are the entities. They simply store a reference to the manager they were created with along with an id. I think I should just store this as a regular reference ( EntityManager& manager; ), right?
And then comes the manager's member functions. I will make methods for, for example retrieving components by entity id and maybe by type. So I want to make the method return something that works like a reference (you can modify the component), be it a real reference or a pointer. The components are owned by the entity manager and are held inside std::maps, and the references to them will be returned purely for the purposes of then observing or modifying them (they are, by the way, plain old data structures without real logic methods). I also, though, want it to be able to signify that it didn't find such a component. What's the best return type of my methods then?
boost::optional, if Boost is an option (hah!) for you.
[editline]19th July 2013[/editline]
And using a reference for the Entities to the EntityManager seems appropriate to me.
[QUOTE=ZeekyHBomb;41521678]boost::optional, if Boost is an option (hah!) for you.
[editline]19th July 2013[/editline]
And using a reference for the Entities to the EntityManager seems appropriate to me.[/QUOTE]
Hmm, that seems a bit too unnecessarily complicated for such simple functionality (downloading a library for it). What are the downsides with just using raw pointers for that?
You might find a bunch of other useful gems in Boost, it is a versatile library, or rather collection of libraries. And most of them are header-only, although with a proper build-system this is not an issue.
boost::optional would carry the exact semantics of what you want, but if you don't want to use Boost raw pointers are fine.
There will be std::optional in C++14 btw.
[editline]19th July 2013[/editline]
[QUOTE=The Sparrow;41520528]Guys, for the love of god why is it so hard to read from an already existing database in android?
what's wrong with calling this:
SQLiteDataBase db = SQLiteDatabase.openDatabase("Personalities.db", null, SQLiteDatabase.OPEN_READWRITE);
All I need to do is read a few simple values from 4 very simple tables. What is the easiest way to do this?[/QUOTE]
There's also OPEN_READONLY, but anyway what's the error you're getting with that?
[QUOTE=ZeekyHBomb;41522140]You might find a bunch of other useful gems in Boost, it is a versatile library, or rather collection of libraries. And most of them are header-only, although with a proper build-system this is not an issue.
boost::optional would carry the exact semantics of what you want, but if you don't want to use Boost raw pointers are fine.
There will be std::optional in C++14 btw.
[editline]19th July 2013[/editline]
There's also OPEN_READONLY, but anyway what's the error you're getting with that?[/QUOTE]
Cool, I'll look into Boost I guess, to see if there are other useful things in it. So if I understood it right, you're supposed to download the entire library?
Well, for me it's just pacman -S boost :P
[url=http://www.boost.org/doc/libs/1_54_0/more/getting_started/windows.html]Here[/url] are their install instructions for Windows.
It's also mentioned which specific libraries you need to build if you want to use them; the others are header-only.
[url=http://www.boost.org/doc/libs/1_54_0/]Here[/url]'s a listing of the available libraries in this release; you can also sort by category. I recommend skipping through the list and reading the introduction of anything that sounds useful to you.
There is [i]a lot[/i] of stuff. Everything is usually well documented.
I think the Boost libs are generally highly regarded, although individual libraries usually have a lot of cross-dependencies with other Boost stuff.
There's a [url=http://www.boost.org/doc/libs/1_54_0/tools/bcp/doc/html/index.html]tool[/url] if you want to extract some Boost functionality to distribute with your project directly. Note that the Boost license is very permissive.
I imagine it being useful if you're using very new functionality.
I don't know how I've survived this long. If my programming habits were porn, it would be akin towards tubgirl. I run into a problem, then deliberately change a string to give it a wrong value to see where the problem gets caught. Then during that time I find another problem, fix it, and forget about the altered string. Spend 5 hours cursing the little shit till I remember I added + "nope" Go back and fix nope, then realize in my 5 hours of shitting all over my program I've gone and changed everything else and probably added a few "fuck" and "afkjbafljk" somewhere else. Eventually I have to start over with my now schizophrenic damn code and its not like I can save any of it because I don't know where I made the cancer spread.
tl;dr I added "nope" to my file path and forgot.
[QUOTE=The Sparrow;41523015]I don't know how I've survived this long. If my programming habits were porn, it would be akin towards tubgirl. I run into a problem, then deliberately change a string to give it a wrong value to see where the problem gets caught. Then during that time I find another problem, fix it, and forget about the altered string. Spend 5 hours cursing the little shit till I remember I added + "nope" Go back and fix nope, then realize in my 5 hours of shitting all over my program I've gone and changed everything else and probably added a few "fuck" and "afkjbafljk" somewhere else. Eventually I have to start over with my now schizophrenic damn code and its not like I can save any of it because I don't know where I made the cancer spread.
tl;dr I added "nope" to my file path and forgot.[/QUOTE]
When you change something add a unique phrase in a comment above it, then grep the codebase for that to find where you have changed things. For example, whenever I think of something I need to do but don't have the time to do right when I realize it, I add a comment where I need to make the changes and prefix it with "TODO" (this keyword is also nice because Vim highlights it by default).
If I don't do that I will forget about it completely, and if it is subtle I can spend hours re-remembering what it is I need to do.
Or debug properly, if possible.
Or use version control and read your diffs.
Can anyone see whats wrong here?
[cpp]bool Texture::LoadFromFile(const std::string &pFileName)
{
mWidth = 0;
mHeight = 0;
if(mTextureID == 0){
glDeleteTextures( 1, &mTextureID );
}
glGenTextures( 1, &mTextureID );
glBindTexture( GL_TEXTURE_2D, mTextureID );
unsigned char* image = SOIL_load_image( pFileName.c_str(), &mWidth, &mHeight, 0, SOIL_LOAD_RGBA );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, mWidth, mHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, image );
SOIL_free_image_data( image );
glGenerateMipmap( GL_TEXTURE_2D );
Texture::Unbind();
return true;
}
[/cpp]
I am getting
[QUOTE]First-chance exception at 0x00000000 in Frameworkd.exe: 0xC0000005: Access violation executing location 0x00000000.
Unhandled exception at 0x74E3C9F1 in Frameworkd.exe: 0xC0000005: Access violation executing location 0x00000000.
The program '[4796] Frameworkd.exe' has exited with code 0 (0x0).[/QUOTE]
On the glGenerateMipmap( GL_TEXTURE_2D );
Perhaps glGenerateMipmap is not initialized properly? It's a function pointer, right?
[QUOTE=ZeekyHBomb;41528937]Perhaps glGenerateMipmap is not initialized properly? It's a function pointer, right?[/QUOTE]
Im just using glew to do it tho, so it should be fine :S
-snip-
Check it then.
[code] if(!glGenerateMipmap){
std::cout << "gosh darn it!" << std::endl;
}[/code]
[QUOTE=ZeekyHBomb;41528958]Check it then.
[code] if(!glGenerateMipmap){
std::cout << "gosh darn it!" << std::endl;
}[/code][/QUOTE]
it printed gosh darn it... Not sure where to go from here
[QUOTE=Richy19;41528969]it printed gosh darn it... Not sure where to go from here[/QUOTE]
Are you checking if glewInit returns any errors?
[cpp]
template <typename First, typename Second, typename... Rest, typename Out>
void getEntities(Out result)
{
std::vector<Entity> entities;
getEntities<Second, Rest>(std::back_inserter(entities));
for (auto entity : entities) {
if (entity.hasComponent<First>()) {
*result++ = entity;
}
}
}
template <typename First, typename Out>
void getEntities(Out result)
{
auto& componentMap = getComponentMap<First>();
for (auto iter : componentMap) {
*result++ = Entity(iter.first, *this);
}
}
[/cpp]
"error C1001: An internal error has occured in the compiler."
At this line:
[cpp]void getEntities(Out result)[/cpp]
Anybody know if it's a compiler bug or if there's something wrong with my code?
edit: Oops, I forgot to mention that I'm using the Visual C++ November 2012 CTP. Maybe I should try the 2013 preview for this?
Definitely a compiler bug, but not being able to call the first definition of getEntities is probably not your intention.
It seems to be valid C++, at least neither gcc nor clang complain.
But the compiler cannot instantiate the function because the typename... Rest cannot be followed by something else, since Rest will "bind" (not sure how to express that) to all remaining types, leaving Out unmatched. Unless both clang and gcc implemented that feature incorrectly.
clang sais this
[code]candidate template ignored: couldn't infer template argument 'Out'[/code]
and gcc pretty much the same.
You can look it up in the standard draft if you like. I'm gonna take a look and see if I can find something relevat to this problem.
[QUOTE=MakeR;41528974]Are you checking if glewInit returns any errors?[/QUOTE]
Yep
[cpp]
GLenum err = glewInit();
if (GLEW_OK != err)
{
// Problem: glewInit failed, something is seriously wrong.
std::cout << "Error: " << glewGetErrorString(err) << std::endl;
std::cin.get();
return 32;
}
[/cpp]
[QUOTE=ZeekyHBomb;41529103]Definitely a compiler bug, but not being able to call the first definition of getEntities is probably not your intention.
It seems to be valid C++, at least neither gcc nor clang complain.
But the compiler cannot instantiate the function because the typename... Rest cannot be followed by something else, since Rest will "bind" (not sure how to express that) to all remaining types, leaving Out unmatched. Unless both clang and gcc implemented that feature incorrectly.
clang sais this
[code]candidate template ignored: couldn't infer template argument 'Out'[/code]
and gcc pretty much the same.
You can look it up in the standard draft if you like. I'm gonna take a look and see if I can find something relevat to this problem.[/QUOTE]
Does that still hold if I say this: I always want to specify all of the type parameters explicitly, except for Out which I never want to specify explicitly? If it still holds, is there some way that I can get it to still work elegantly? Because putting it at the start of the list will make things ugly because it will force me to specify it explicitly if I want to specify any other parameters.
[QUOTE=Richy19;41529115]Yep
[cpp]
GLenum err = glewInit();
if (GLEW_OK != err)
{
// Problem: glewInit failed, something is seriously wrong.
std::cout << "Error: " << glewGetErrorString(err) << std::endl;
std::cin.get();
return 32;
}
[/cpp][/QUOTE]
I know it sounds obvious, but is your problematic code [I]definitely[/I] running after glewInit has been called? Put a breakpoint on both and see which one is hit first.
Sorry, you need to Log In to post a reply to this thread.