Jump to content

Phat Looser

Members
  • Posts

    627
  • Joined

  • Last visited

Everything posted by Phat Looser

  1. Sorry for double posting, sorry for failing so hard: I made a mistake in the implementation. The password wasn't added (line 15 and line 27) iaEncryptionArray = {}; iaDecryptionArray = {}; caPassword = ""; iPasswordLength = 0; caText = ""; caEncryptedText = ""; iPasswordPosition = 1; function addEncryptionPasswordChar(value) iPasswordPosition = iPasswordPosition + 1; if (iPasswordPosition > iPasswordLength) then iPasswordPosition = 1; end output = value + string.byte(caPassword,iPasswordPosition); if (output > 999) then output = output - 1000; end return output; end function subsEncryptionPasswordChar(value) iPasswordPosition = iPasswordPosition - 1; if (iPasswordPosition < 1) then iPasswordPosition = iPasswordLength; end output = value - string.byte(caPassword,iPasswordPosition); if (output < 0) then output = output + 1000; end return output; end function generateEncryptionPassword() iPasswordHash = 0; caOutput = ""; for i=1, iPasswordLength, 1 do iPasswordHash = iPasswordHash + string.byte(caPassword,i); -- char! end for i=1, iPasswordLength, 1 do caOutput = caOutput .. string.char(iPasswordHash % string.byte(caPassword,i)); -- char! char! end return caOutput; end function stringSetChar(string,char,pos) length = string.len(string); if pos > length then return string; end string = string.sub(string,1,pos) .. char .. string.sub(string,pos+1,length); return string; end function generateEncryptionArray() generateDecryptionArray(); end function generateDecryptionArray() caEncryptionPassword = generateEncryptionPassword(caPassword); for i=0, 999, 1 do iaEncryptionArray[i]=NIL; end iPosition = 0; n=1; for i=0, 999, 1 do n = n + 1; if (string.byte(caPassword,n) == NIL) then n=1; end iPosition = iPosition + string.byte(caEncryptionPassword,n) + string.byte(caPassword,n); iPosition = iPosition % 1000; while (iaEncryptionArray[iPosition]) do iPosition = iPosition + 1; if (iPosition >= 1000) then iPosition = iPosition - 1000; end end iaEncryptionArray[iPosition] = i; iaDecryptionArray[i] = iPosition; end end function encrypt() generateEncryptionArray(); iTextSize = string.len(caText); iEncryptedTextSize = iTextSize*3; caEncryptedText = ""; aEncryptedText = {}; for i=1, iTextSize, 1 do value = string.byte(caText,i); n=i*3; if (value < 10) then value = string.format("00%i",value); elseif (value < 100) then value = string.format("0%i",value); else value = string.format("%i",value); end aEncryptedText[(i-1)*3+1] = string.byte(value,1) - 48; aEncryptedText[(i-1)*3+2] = string.byte(value,2) - 48; aEncryptedText[(i-1)*3+3] = string.byte(value,3) - 48; end iCounter = 1; iPasswordPosition = 1; for runs=1, 32, 1 do for i=1, iEncryptedTextSize, 1 do iCounter = iCounter + 1; pos1 = i; pos2 = i+1; pos3 = i+2; if (pos2 > iEncryptedTextSize) then pos2 = pos2 - iEncryptedTextSize; pos3 = pos3 - iEncryptedTextSize; elseif (pos3 > iEncryptedTextSize) then pos3 = pos3 - iEncryptedTextSize; end h = aEncryptedText[pos1]; z = aEncryptedText[pos2]; e = aEncryptedText[pos3]; value = 100*h + 10*z + e; value = iaEncryptionArray[value]; value = subsEncryptionPasswordChar(value); h = math.floor(value / 100); value = value - 100*h; z = math.floor(value / 10); value = value - 10*z; e = value; aEncryptedText[pos1] = h; aEncryptedText[pos2] = z; aEncryptedText[pos3] = e; end end caEncryptedText = ""; for i=1,iEncryptedTextSize,1 do caEncryptedText = caEncryptedText .. string.format("%i",aEncryptedText[i]); end end function decrypt() generateDecryptionArray(); iEncryptedTextSize = string.len(caEncryptedText); aEncryptedText = {}; for i=1,iEncryptedTextSize,1 do aEncryptedText[i] = string.byte(caEncryptedText,i) - 48; end caEncryptedText = ""; iPasswordPosition = - (iEncryptedTextSize*32) - 1; iPasswordPosition = iPasswordPosition % iPasswordLength + 1; for runs=1, 32, 1 do for i=iEncryptedTextSize, 1, -1 do pos1 = i; pos2 = i+1; pos3 = i+2; if (pos2 > iEncryptedTextSize) then pos2 = pos2 - iEncryptedTextSize; pos3 = pos3 - iEncryptedTextSize; elseif (pos3 > iEncryptedTextSize) then pos3 = pos3 - iEncryptedTextSize; end h = aEncryptedText[pos1]; z = aEncryptedText[pos2]; e = aEncryptedText[pos3]; value = 100*h + 10*z + e; value = addEncryptionPasswordChar(value); value = iaDecryptionArray[value]; h = math.floor(value / 100); value = value - 100*h; z = math.floor(value / 10); value = value - 10*z; e = value; aEncryptedText[pos1] = h; aEncryptedText[pos2] = z; aEncryptedText[pos3] = e; end end iTextSize = iEncryptedTextSize / 3 caText = ""; for i=1,iEncryptedTextSize,1 do caEncryptedText = caEncryptedText .. string.format("%i",aEncryptedText[i]); end for i=1, iTextSize, 1 do n = (i-1)*3+1; char = aEncryptedText[n]*100 + aEncryptedText[n+1]*10 + aEncryptedText[n+2]; if char > 255 then caText = "wrong password!"; return; end caText = caText .. string.char(char); end end function encryptString(caTextInput,caPasswordInput) if caTextInput == nil or caPasswordInput == nil then return nil; end caText = caTextInput; caPassword = caPasswordInput; iPasswordLength = string.len(caPassword); encrypt(); return (caEncryptedText); end function decryptString(caTextInput,caPasswordInput) if caTextInput == nil or caPasswordInput == nil then return nil; end caEncryptedText = caTextInput; caPassword = caPasswordInput; iPasswordLength = string.len(caPassword); decrypt(); return (caText); end The string: A simple LUA encryption Was encrypted to: 682119734823703509077954997710015337233693472802500191840149774364729 The string: 1234567890 Was encrypted to: 933712879701133814501918158559 The string: abcdefghijklmnopqrstuvwxyz Was encrypted to: 530526185999974651768906379994835597147588329912489932067818658885112960517611 The string: TEST Was encrypted to: 627098568592 The string: one Was encrypted to: 454931977
  2. with that secret password i encrypted: A simple LUA encryption to: 888953271697817971988875429150003339473916115385183229145025698478333 and 123 test to 589213431067573308035761 and 1234567890 to 599957627210660816794255945607 and abcdefghijklmnopqrstuvwxyz to 363695469390506373834224316510624908352602626076666225352477454426305393478617 I just want you to BREAK the algorithm. All of these lines use the same password. If you want to encrypt/decrypt something yourself, be sure to use ASCII text and an ASCII password. # verschl = encryptString("Test","Password"); # plaintext = decryptString(verschl,"Password"); I tested it with random text several times. When you find out the password (which is 7 chars in size), my algorithm fails (plain text attack). Imagining storing data client side and having the client find out the decryption password, i.e. by saving its position at a specified place! I know the password by heart, so, if you want me to encrypt MOAR, then I'll do it. I also have this algorithm in C, so, if you want to have the sourcecode for that, I should be able to provide it (even though i changed some things in the LUA sourcecode, i.e. adding the password in every step of the encryption). Edit: I found out there may be a bug. The reason is the "iPasswordPosition" integer. This bug should be solved easily. Edit2: Even though there is a "bug", it works, and I have no idea why. iPasswordPosition is set to 1 every time. Then, it is increased. Why the hack does it decrypt the same way it encrypts and still work?
  3. MD5 is not an encryption algorithm. Also, I just did it. There was no reason for doing it except doing it.
  4. Since I do not remember any secure hashing or encryption algorithms in LUA, I made one myself, based on the idea of the blowfish algorithm (but less complicated). iaEncryptionArray = {}; iaDecryptionArray = {}; caPassword = ""; caPasswordLength = 0; caText = ""; caEncryptedText = ""; iPasswordPosition = 1; function addEncryptionPasswordChar(value) iPasswordPosition = iPasswordPosition + 1; if (iPasswordPosition > caPasswordLength) then iPasswordPosition = 1; end output = value + string.byte(caPassword,position); if (output > 999) then output = output - 1000; end return output; end function subsEncryptionPasswordChar(value) iPasswordPosition = iPasswordPosition + 1; if (iPasswordPosition > caPasswordLength) then iPasswordPosition = 1; end output = value - string.byte(caPassword,position); if (output < 0) then output = output + 1000; end return output; end function generateEncryptionPassword() iPasswordHash = 0; caOutput = ""; for i=1, caPasswordLength, 1 do iPasswordHash = iPasswordHash + string.byte(caPassword,i); -- char! end for i=1, caPasswordLength, 1 do caOutput = caOutput .. string.char(iPasswordHash % string.byte(caPassword,i)); -- char! char! end return caOutput; end function stringSetChar(string,char,pos) length = string.len(string); if pos > length then return string; end string = string.sub(string,1,pos) .. char .. string.sub(string,pos+1,length); return string; end function generateEncryptionArray() generateDecryptionArray(); end function generateDecryptionArray() caEncryptionPassword = generateEncryptionPassword(caPassword); for i=0, 999, 1 do iaEncryptionArray[i]=NIL; end iPosition = 0; n=1; for i=0, 999, 1 do n = n + 1; if (string.byte(caPassword,n) == NIL) then n=1; end iPosition = iPosition + string.byte(caEncryptionPassword,n) + string.byte(caPassword,n); iPosition = iPosition % 1000; while (iaEncryptionArray[iPosition]) do iPosition = iPosition + 1; if (iPosition >= 1000) then iPosition = iPosition - 1000; end end iaEncryptionArray[iPosition] = i; iaDecryptionArray[i] = iPosition; end end function encrypt() generateEncryptionArray(); iTextSize = string.len(caText); iEncryptedTextSize = iTextSize*3; caEncryptedText = ""; aEncryptedText = {}; iPasswordPosition = 1; for i=1, iTextSize, 1 do value = string.byte(caText,i); n=i*3; if (value < 10) then value = string.format("00%i",value); elseif (value < 100) then value = string.format("0%i",value); else value = string.format("%i",value); end aEncryptedText[(i-1)*3+1] = string.byte(value,1) - 48; aEncryptedText[(i-1)*3+2] = string.byte(value,2) - 48; aEncryptedText[(i-1)*3+3] = string.byte(value,3) - 48; end for i=1,iEncryptedTextSize,1 do caEncryptedText = caEncryptedText .. string.format("%i",aEncryptedText[i]); end for runs=1, 32, 1 do for i=1, iEncryptedTextSize, 1 do pos1 = i; pos2 = i+1; pos3 = i+2; if (pos2 > iEncryptedTextSize) then pos2 = pos2 - iEncryptedTextSize; pos3 = pos3 - iEncryptedTextSize; elseif (pos3 > iEncryptedTextSize) then pos3 = pos3 - iEncryptedTextSize; end h = aEncryptedText[pos1]; z = aEncryptedText[pos2]; e = aEncryptedText[pos3]; value = 100*h + 10*z + e; value = iaEncryptionArray[value]; value = subsEncryptionPasswordChar(value,i); h = math.floor(value / 100); value = value - 100*h; z = math.floor(value / 10); value = value - 10*z; e = value; aEncryptedText[pos1] = h; aEncryptedText[pos2] = z; aEncryptedText[pos3] = e; end end caEncryptedText = ""; for i=1,iEncryptedTextSize,1 do caEncryptedText = caEncryptedText .. string.format("%i",aEncryptedText[i]); end end function decrypt() generateDecryptionArray(); iEncryptedTextSize = string.len(caEncryptedText); aEncryptedText = {}; for i=1,iEncryptedTextSize,1 do aEncryptedText[i] = string.byte(caEncryptedText,i) - 48; end caEncryptedText = ""; iPasswordPosition = 1; for runs=1, 32, 1 do for i=iEncryptedTextSize, 1, -1 do pos1 = i; pos2 = i+1; pos3 = i+2; if (pos2 > iEncryptedTextSize) then pos2 = pos2 - iEncryptedTextSize; pos3 = pos3 - iEncryptedTextSize; elseif (pos3 > iEncryptedTextSize) then pos3 = pos3 - iEncryptedTextSize; end h = aEncryptedText[pos1]; z = aEncryptedText[pos2]; e = aEncryptedText[pos3]; value = 100*h + 10*z + e; value = addEncryptionPasswordChar(value,i); value = iaDecryptionArray[value]; h = math.floor(value / 100); value = value - 100*h; z = math.floor(value / 10); value = value - 10*z; e = value; aEncryptedText[pos1] = h; aEncryptedText[pos2] = z; aEncryptedText[pos3] = e; end end iTextSize = iEncryptedTextSize / 3 caText = ""; for i=1,iEncryptedTextSize,1 do caEncryptedText = caEncryptedText .. string.format("%i",aEncryptedText[i]); end for i=1, iTextSize, 1 do n = (i-1)*3+1; char = aEncryptedText[n]*100 + aEncryptedText[n+1]*10 + aEncryptedText[n+2]; if char > 255 then caText = "wrong password!"; return; end caText = caText .. string.char(char); end end function encryptString(caTextInput,caPasswordInput) caText = caTextInput; caPassword = caPasswordInput; caPasswordLength = string.len(caPassword); encrypt(); return (caEncryptedText); end function decryptString(caTextInput,caPasswordInput) caEncryptedText = caTextInput; caPassword = caPasswordInput; caPasswordLength = string.len(caPassword); decrypt(); return (caText); end verschl = encryptString("Test","Password"); plaintext = decryptString(verschl,"Password"); print(addEncryptionPasswordChar(subsEncryptionPasswordChar(1,1),1)); print(plaintext); The only problem about it is that the output is three times larger then the input, since I found no way of doing a bitwise operations in LUA. Using this algorithm i encrypted: A simple LUA encryption to: 888953271697817971988875429150003339473916115385183229145025698478333 and 123 test to 589213431067573308035761 and 1234567890 to 599957627210660816794255945607 and abcdefghijklmnopqrstuvwxyz to 363695469390506373834224316510624908352602626076666225352477454426305393478617 The password is 7 chars long. The algorithm is known, the plain text is known, if you are able to find out the password, I consider this algorithm to be a failure.
  5. The reason of my suggestion was no attemt to keep the admins awake 24 / 7, the reason was a identical handling of the hotkeys for all gamemodes available. The idea behind it was to make customizing easyer for both, the admin and the user, since the admin (scripter) only needs one command to create a new hotkey, and the user already knows where to search for that hotkey. And for those who don't get it, there is the F9 key.
  6. Your server needs some sort of syncro mod - there is some guys which are invincible, and thats annoying me. Or do you use it already? I have forgotten.
  7. -Are you using a router? If you don't know what a router is, educate yourself. -Are you connected to the interwebs directly? -What kind of firewall does your computer use? Its quite simple. I think you are using a router, so you have to tell the router to forward connection requests to your computer (your "internal IP address"). And here is how it is done: I won't, my quote will. ALSO: Routers have user manuals. If you can't read or understand those, noone can help you.
  8. Sounds good, thank you. I think I just figured out that "some point" means "after 1.0". I didn't have much time being at the QA, and that didn't change at all. I'm just too busy trolling people and doing stupid stuff.
  9. No, more like... The key appears in THIS LIST (i uploaded the picture, imageshack comes later). This way the server owner does not need to write a whole set of functions for hotkeys. And, yeah, the server totally fails as soon as it needs hotkeys. I mean, who needs a "buy" key in an RPG server when he stands in front of a shopping cart and wants to buy some flowers? Or who needs to have an "drink energy drink" button in the middle of a battle? Noone. Typing "/drink_energydrink" or "/reload" is much faster then pressing a button... Just what did I think. Sorry.
  10. Hi there, After a long time of mindless babbling and sitting in the corner drooling, and of course after some scripting etc. I had the idea that MTA would be able to give scripters the opportunity to add key binds into the mta menu (I am talking about the menu you can see when you press "escape" and klick onto the button "settings" and go into the tab "controls", the place where you set things like "run forward, run backward, jump" - the control panel so to say). I am bad at explaining, so just think you are a player and just joined a deathmatch map. The mothafacking admin sais you can only reload when you mothafacking set the mothafacking reload key. So you mothafacking press escape and mothafacking go to the key settings, you mothafacking find a new option called "mothafacking kewl reload" there, and you click it and press "r". So you bound the r key to reload. Then you are tired of those mothafacking snipers on this mothafacking server, and you quit. When you join a neat RPG server after that, with a neat little girl admin, who wants to offer some cookie crisps - but you need to bind your key. So what do you do? The cute admin tells you that the fairyland can be accessed by pressing escape, clicking settings, going to the key settings and binding a key to "cooooooookies". You do as the admin asks, and the "mothafacking kewl reload", its gone! But there is a new option: "neat little cookie crisps". You bind "r" to it. Now you can mothafacking reload with "r" to kill those mothafacking snipers on the mothafacking kewl deathmatch server, or you can order neat cookies by pressing "r" in the fairyland server. Its just an idea, because until now I experienced some sort of "keybind chaos".
  11. Thats true, Talidan, but I think he is talking about modding data making "cheats" possible. If the weapons.dat would be updated by the server such things would not work. I just don't know if reloading data is already possible. After all, reloading object collisions seems to work already.
  12. Fame. The ability to script because he can. And, the best payment I can imagine is to get the debug messages so I can improve the script. Admin state? What for. Someone who scripts for admin powers will open his own server.
  13. Word. And you have to have a good hard disc to be able to drive through the map without lagging. But I don't know anyone who has more good ideas then him. Get ready for an overdrive!
  14. Its not that I hate freeroam, it was just so much information flowing through my brain that i suffered from epilepsie.
  15. Yep, this guy sure has ideas.
  16. I can tell you why your server isn't that popular: I joined it and was totally confused what to do.
  17. Phat Looser

    MTA Dead?

    I think just like Unreal 1, MTA will never die. There still are MTA:VC Servers online, and there still is people playing it. The only thing that is REALLY annoying is the fact that the weapons have a extremely low range, compared to the size of San Andreas, and that the SA streaming engine - erm - is bs.
  18. Phat Looser

    MTA Dead?

    I don't think somebody made it clear that we will not do MTA:IV. We sure could start it someday, more likely even open source from the very beginning. Blue core allows us to port it to other games, without rewriting tonns of code we got for the last years. Max Payne would be fun in MP.
  19. The problem is, when I am driving and someone stands nearby, I am dodging him and do NOT hit him on my own computer - sometimes it still adds me wanted level. This is a bit inconvenient.
  20. I want to make an RPG script without sync issues, i.e. when someone is hit with an katana, the one who hit him gets his wanted level increased. At the moment it is almost completely random if you hit him or not, especially when you drive a car through a crowded area.
  21. Hi there, I wanted to know if there is any possibility to change the call of the onClientPlayerDamage Event in a way it enables me to recognize the damage the other players receive (the small health ups and downs you can see when you shoot at a player). At the moment, the function called only is called when the own player receives the damage.
  22. For those who are a little bit experienced: Create a registry file which contains: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\mta] @="URL:MTA San Andreas Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOT\mta\DefaultIcon] @="C:\\Programme\\MTA San Andreas\\Multi Theft Auto.exe" [HKEY_CLASSES_ROOT\mta\shell] [HKEY_CLASSES_ROOT\mta\shell\open] [HKEY_CLASSES_ROOT\mta\shell\open\command] @="\"C:\\Program Files\\MTA San Andreas\\Multi Theft Auto.exe\"%1" of course, you should think about having the right path to MultiTheftAuto, shouldn't you?
  23. That means bitches like me can "invent" an anticheat send you the sauce? Sounds perfect to me. Only problem is, I can't debug it then.
  24. Is it clientside? For the case its clientside: addEventHandler ( "onPlayerWeaponSwitch", getLocalPlayer(), minigun ) setTimer ( killMiniNoob, 200, 0, source, -5 ) kickPlayer ( source, source, "minigun" ) doesn't make much sense.
×
×
  • Create New...