Jump to content

Recommended Posts

Posted

Since I wasn't able to find it anywhere on the net I decided to make it myself.

For whoever needs it in the future :)

 

   private static byte[] Encrypt(string password)
   {
    var key = new byte[16];
       long one, two, three, four;
       var dst = new byte[16];
       var nBytes = password.Length;

       for (var i = 0; i < nBytes; i++ )
       {
           key[i] = Encoding.ASCII.GetBytes(password.Substring(i, 1))[0];
           dst[i] = key[i];
       }

    long rslt  = @key[0] + @key[1]*256 + @key[2]*65536 + @key[3]*16777216;
    one = rslt * 213119 + 2529077;
       one = one - ToInt32(one / 4294967296) * 4294967296;

    rslt  = @key[4] + @key[5]*256 + @key[6]*65536 + @key[7]*16777216;
       two = rslt * 213247 + 2529089;
       two = two - ToInt32(two / 4294967296) * 4294967296;

    rslt  = @key[8] + @key[9]*256 + @key[10]*65536 + @key[11]*16777216;
       three = rslt * 213203 + 2529589;
       three = three - ToInt32(three / 4294967296) * 4294967296;

    rslt  = @key[12] + @key[13]*256 + @key[14]*65536 + @key[15]*16777216;
       four = rslt * 213821 + 2529997;
       four = four - ToInt32(four / 4294967296) * 4294967296;

       key[3] = ParseInt(one / 16777216);
       key[2] = ParseInt((((Int32)(one - @key[3] * 16777216)) / 65535));
       key[1] = ParseInt((one - @key[3] * 16777216 - @key[2] * 65536) / 256);
       key[0] = ParseInt((one - @key[3] * 16777216 - @key[2] * 65536 - @key[1] * 256));

       key[7] = ParseInt(two / 16777216);
       key[6] = ParseInt((two - @key[7] * 16777216) / 65535);
       key[5] = ParseInt((two - @key[7] * 16777216 - @key[6] * 65536) / 256);
       key[4] = ParseInt((two - @key[7] * 16777216 - @key[6] * 65536 - @key[5] * 256));

       key[11] = ParseInt(three / 16777216);
       key[10] = ParseInt((three - @key[11] * 16777216) / 65535);
       key[9] = ParseInt((three - @key[11] * 16777216 - @key[10] * 65536) / 256);
       key[8] = ParseInt((three - @key[11] * 16777216 - @key[10] * 65536 - @key[9] * 256));

       key[15] = ParseInt(four / 16777216);
       key[14] = ParseInt((four - @key[15] * 16777216) / 65535);
       key[13] = ParseInt((four - @key[15] * 16777216 - @key[14] * 65536) / 256);
       key[12] = ParseInt((four - @key[15] * 16777216 - @key[14] * 65536 - @key[13] * 256));

       dst[0] = ParseInt(dst[0] ^ @key[0]);

       for (var i = 1; i < dst.Length; i++)
           dst[i] = ParseInt(@dst[i] ^ @dst[i - 1] ^ @key[i]);

       for (var i = 0; i < dst.Length; i++)
           if (dst[i] == 0)
               dst[i] = 102;
               
return dst;
   }

   private static int ToInt32(long val)
   {
       return Convert.ToInt32(val);
   }
   
   private static byte ParseInt(long val)
   {
       return BitConverter.GetBytes(val)[0];
   }

Posted

It's a simple conversion of every single registration script in asp/php's encryption method for storing passwords when users register.

 

Infact it's scarily alot of copy paste, just wit a few changes to C#/.NET syntax.

 

Not quite sure how it's useful, if you can't do this you wouldn't mess with it in the first place.

Posted

in English please?  ;D

That was English.

 

A side note, this hashing algorithm is notoriously insecure, and has an incredibly alarming collision rate.

You should use hAuthD and enable hint's custom md5 password encryption, which is a hell of a lot more secure.

Posted

That was English.

 

A side note, this hashing algorithm is notoriously insecure, and has an incredibly alarming collision rate.

You should use hAuthD and enable hint's custom md5 password encryption, which is a hell of a lot more secure.

 

U MAD?! U NO LIKE BRUT FOUS?!

Posted

.... what a big fuzz for nothing

Thanks for sharing your awesomeness Anders

 

If you can improve the algorithm just do so and share it?

C# is widely used to create web applications so it's not strange I'm sharing this at all.

Posted

.... what a big fuzz for nothing

Thanks for sharing your awesomeness Anders

 

If you can improve the algorithm just do so and share it?

C# is widely used to create web applications so it's not strange I'm sharing this at all.

 

Do you even know how the system of authentication works together with the first registration of a users information?

In general how authentication processes has to be tied with the user info it has from whatever previous source?

 

It sounds like you don't.

Posted

Great for pointing out that you do know how it works.

Thanks for contributing it to this topic. Really useful information.

 

Just like your fantastic useful information of saving people 3 minutes with this.

 

Lets forget the fact that'd Anarchy pointed out how crap and weak the "hash" if you can call it that is, in l2.

Not me.

 

Using a new hash, you can google for it.

Am i awesome for posting a SHA2 or ever SHA1 hash copy pasted from somewhere?

Won't really help when no authentication process known in L2 supports it, will it? ;)

 

Your a kid who's butthurt over not getting praise, but instead someone saying what you share is pretty much already shared, in another script/language.

Which is what i did - FYI - not insult you in anyway.

 

Stay in school kiddo :O

Posted

That was English.

 

A side note, this hashing algorithm is notoriously insecure, and has an incredibly alarming collision rate.

You should use hAuthD and enable hint's custom md5 password encryption, which is a hell of a lot more secure.

I think he meant he did not understand it

Posted

You must be really awesome that you can fix it in 3minutes. Thanks for pointing out how awesome you are again.

Still..  I don't really care what your opinion is about the "hash". Just shared it to I can save Anders 3min :)

(PS: I'm glad I'm still studying. Someone as awesome as you doesn't need school ;))

  • 2 weeks later...
Posted

There u go hCrypt in C#.

        using System;

       private const string MD5Password = "key";
       private static string hCrypt(string password)
       {
           var md5Password = MD5Password.ToCharArray();
           var s = (EncryptMD5(password) + EncryptMD5(MD5Password)).ToCharArray();
           int j = 0;
        for (var i = 0; i < s.Length; i++)
        {
               if (j >= MD5Password.Length) j = 0;

               var calcu = s[i] ^ md5Password[j];
            s[i] = (char)calcu;
	        j++;
        }
           return EncryptMD5(new string(s));
       }


       public static string EncryptMD5(string originalPassword)
       {
           return BitConverter.ToString(((new MD5CryptoServiceProvider()).ComputeHash(Encoding.UTF8.GetBytes(originalPassword)))).Replace("-", "").ToLower();
       }

Posted

There u go hCrypt in C#.

        private const string MD5Password = "key";
        private static string hCrypt(string password)
        {
            var md5Password = MD5Password.ToCharArray();
            var s = (EncryptMD5(password) + EncryptMD5(MD5Password)).ToCharArray();
            int j = 0;
        for (var i = 0; i < s.Length; i++)
        {
                if (j >= MD5Password.Length) j = 0;

                var calcu = s[i] ^ md5Password[j];
            s[i] = (char)calcu;
	        j++;
        }
            return EncryptMD5(new string(s));
        }


        public static string EncryptMD5(string originalPassword)
        {
            return BitConverter.ToString(((new MD5CryptoServiceProvider()).ComputeHash(Encoding.UTF8.GetBytes(originalPassword)))).Replace("-", "").ToLower();
        }

is seems good but look the first lines :S fix it!!!
  • Vision changed the title to C# L2Off Password encryption

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • This post originally appeared on MmoGah. Odin: Valhalla Rising is an ambitious open-world MMORPG developed with Unreal Engine 4, offering breathtaking visuals and immersive gameplay. I will share everything you need to know before starting it.     Re-rolling In Odin, re-rolling isn't a practical strategy. Unlike most gacha games, where it's common to reset for better initial pulls, Odin focuses heavily on long-term growth. The earlier you begin playing and developing your character, the more advantages you'll gain over time. Instead of spending your efforts on re-rolling for ideal equipment, it's better to dive in and start progressing right away.   Server Selection Before starting your character, selecting a server is a crucial step. Since Odin doesn't support cross-server gameplay, coordinating with your friends, family, or guildmates is essential to ensure everyone creates their characters on the same server. Take the time to plan with your group beforehand. After deciding on a server, your next major choice will be picking a class.   Class Breakdown Odin features four primary starting classes: Warrior, Sorceress, Rogue, and Priest. Each class comes with its own distinct playstyle and unique strengths, so choose wisely, as your selection is permanent. However, even free-to-play players can create up to three characters on one server, giving you the flexibility to try different options and find the one that matches your preferences.   Quest and Leveling Once your character is created, your initial objective is to work through the main questline. This acts as both a tutorial and a method for early leveling. Odin simplifies the process with a convenient quest button that handles navigation, starts dialogues, and even enables auto-combat. This user-friendly feature allows beginners to grasp the basics of the game without feeling overloaded.   Auto Combat and No Kill-steal Mode Auto combat is an essential feature in Odin, enabling your character to battle monsters autonomously. This system allows you to effortlessly gain experience and loot, even while you're busy studying, cooking, or unwinding. To optimize its use, activate the no-kill-steal mode. This setting prevents your character from targeting monsters already engaged by other players, helping you avoid conflicts or potential PvP situations. However, if a quest becomes difficult to complete due to overcrowded areas, you can temporarily disable this mode to overcome the obstacle and move forward.   Item Management and Potions Don't overlook the importance of consumable items, especially health potions. These can be purchased, along with buffs, from general merchants in villages, and they play a crucial role in improving your combat efficiency and ensuring your survival. Always aim to keep a full stock of HP potions and carry buffs that boost attack, defense, or regeneration in batches of 5-10 for convenience.   Once you've acquired your consumables, assign them to your quick slots located at the bottom center of the screen. Swiping down activates these slots, and items like potions will automatically be used when necessary, so you don't need to worry about them mid-battle. Keep a close eye on your potion reserves, as running out during a tough fight could leave you vulnerable before reaching a safe area. In the early stages of the game, it's better to return to town for a restock if supplies are low rather than risking unnecessary defeats. You can also enable notifications to alert you when your health or potion count drops too low—a handy feature for staying prepared if your attention is elsewhere.   Leveling and AFK Farming Once you've mastered the fundamentals, the next step is to focus on leveling up and enhancing your character. Gaining levels is your primary source of progression early on, as it not only improves your stats but also unlocks crucial game features and new abilities. At this stage, simply sticking to the main questline provides a reliable and efficient way to gain experience.   Additionally, Odin includes a highly convenient idle feature called AFK mode. This allows your character to keep farming for resources and experience even when the game is closed, with a maximum duration of 8 hours per day. It's an excellent option for making progress while you're asleep, commuting, or otherwise occupied.   Gear Upgrades When the time comes to improve your gear, the initial focus should be on upgrading from normal-grade equipment to high-grade items. These provide significantly better stats and can be enhanced further to increase their effectiveness. Enhancing requires enhancement stones and gold, but it's important to stay within the safe enhancement limit. Attempting upgrades beyond this limit carries the risk of destroying your gear if the enhancement fails. Stick to safe enhancements until you've gained more experience and accumulated spare equipment to mitigate potential losses.   Skill Purchases When you've accumulated enough gold, it's time to invest in skills. These are crucial for enhancing your combat abilities and provide key benefits tailored to your class, whether it's increasing damage output, improving healing capabilities, or adding valuable utility. Before purchasing, ensure your character meets the level prerequisites for each skill. Your ultimate goal will be progressing through and completing the main questline in Midgard as you continue to develop your character.   Unlocking Jotenheim Finishing this milestone grants you access to the next region, Jetunheim, unlocking a variety of new content and challenges. This marks your first significant achievement in the game and is an essential early objective to strive for as you progress.   Joining a Guild Joining a guild is a highly beneficial step in Odin. Guilds not only provide opportunities for social interaction and group activities but also offer passive bonuses that can significantly enhance your gameplay. Even if you're not particularly active socially, being part of any guild is advantageous. The guild feature becomes accessible after completing Chapter 4, Quest 19 of the main story.   Guilds provide various perks, including buffs that scale with the guild's level. Additionally, you can earn guild coins by contributing through donations, quest completions, or regular logins. These coins can be exchanged for valuable rewards, such as epic-grade armor. The more you actively contribute to your guild, the greater the overall benefits for both you and the guild itself. Joining early and staying involved will undoubtedly strengthen your progression in the game.   Conclusion Here is the end of this beginners' guide. I hope these tips will help you level fast in Odin.
    • You can actually make a pseudomount code in your server, that way it can be displayed.. a friend made it for the l2off and i extended it a bit.. if u have l2off i might be able to help u on that
    • Discord : utchiha_market Telegram : https://t.me/utchiha_market Auto Buy Store : https://utchihamkt.mysellauth.com/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
    • Chill guys, Guytis ain't competent enough to make malware even if he wanted to
  • Topics

×
×
  • Create New...