Rewrite the encryption algorithm of Agileeas.net SOA middleware platform account password

Source: Internet
Author: User

I. Introduction of the Platform

The Agileeas.net SOA middleware platform is based on agile parallel development ideas and Microsoft. NET component (component) development technology and a rapid development application platform. To help small and medium-sized software enterprises to establish a rapid market change for the development team to achieve savings in development costs, shorten development time, quickly adapt to market changes.

The Agileeas.net SOA Middleware platform provides best practices for agile rapid development of software engineering by providing a large number of basic support functions such as the IOC, ORM, SOA, distributed architecture, and the plug-in development system supported by the agile concurrency development approach, as well as providing a large number of entities, Data model design generation tools, code generation tools to help small and medium-sized software developers grow rapidly.

Agileeas.net platform fully grasp the current rapid development of the software industry trends, based on agile parallel development, rapid adaptation to the market such simple software engineering practice, using the industry's widely used Microsoft. NET component (component) Development technology practices This kind of development idea, helps the software enterprise realize "the agile change, the quick fit" the goal, thus helps the software enterprise to win the opportunity in the intense market competition and obtains the higher return.

Second, the account encryption, verification algorithm replacement

Agileeas.net SOA middleware platform has been using the built-in cryptographic encryption algorithm, with many users, for the security needs of the system, in order to provide a strategy, with their own cryptographic algorithm algorithm to replace the Agileeas.net SOA middleware platform built-in cryptographic encryption algorithm.

To implement this requirement, we define the password provider Interface IPasswordProvider:

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceEAS. explorer{/// <summary>    ///The user password Provider interface. /// </summary>     Public InterfaceIPasswordProvider {/// <summary>        ///encrypts the specified password. /// </summary>        /// <param name= "password" >the password to encrypt. </param>        ///<returns>the password after the load. </returns>        byte[] Encrypt (stringpassword); /// <summary>        ///verifies that the given password matches the specified key. /// </summary>        /// <param name= "password" >the password to verify. </param>        /// <param name= "key" >the key to validate. The key has a length of 64 bytes. </param>        /// <returns>returns True if a key that matches the key can be generated by the specified key, otherwise false. </returns>        BOOLVerify (stringPasswordbyte[] key); }}

The IPasswordProvider interface defines a two-way, encrypt method used to generate a password corresponding to the added count of the password, verify method for the plaintext password and encrypted password.

III. implementation and Configuration

Here I take a friend's implementation as an example, he wants to change the password encryption algorithm to MD5, let's take a look at the specific approach.

First, you need to build a class library project, and reference Eas.explorer, EAS. Microkernel, EAS. Explorer assembly, create a class and implement the IPasswordProvider interface, the project code structure is as follows:

The Md5password code is as follows:

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingsystem.web;usingEAS. Explorer;usingSystem.Security.Cryptography;usingSystem.Text;usingSystem.IO;usingSystem.Text;namespacemy.passwords{ Public classMd5password:ipasswordprovider {#regionIPasswordProvider Members Public byte[] Encrypt (stringpassword) {            byte[] result =Encoding.Default.GetBytes (password.            Trim ()); MD5 MD5=NewMD5CryptoServiceProvider (); byte[] Output =Md5.computehash (Result); byte[] buffer =New byte[ -]; Buffer.blockcopy (Output,0, Buffer,0, -); returnbuffer; }         Public BOOLVerify (stringPasswordbyte[] key) {            byte[] result =Encoding.Default.GetBytes (password.            Trim ()); MD5 MD5=NewMD5CryptoServiceProvider (); byte[] Output =Md5.computehash (Result); byte[] buffer =New byte[ -]; Buffer.blockcopy (Output,0, Buffer,0, -); returnEAS.        Security.Bytes.Equals (buffer, key); }        #endregion    }}

Compile the code to get My.Passwords.dll, and then modify the relevant configuration file, such as EAS.SOA.Server.exe.config, Web. config, to add the following configuration:

<!-- Cryptographic Algorithms  -      <  name= "PasswordProvider"  assembly= "my.passwords"  type = "My.Passwords.MD5Password" Lifestyletype = "Singleton" />

End configuration.

Iv. example code download

This article covers the domain Model designer code plug-in example, the source code has been placed in the latest version of Agileeas.net SOA middleware, please download through the Agileeas.net SOA middleware Platform official website, or download it by the following way:

Direct download: agileeas.net SOA 5.2 Download, Http://112.74.66.105/downloads/eas/agileeas.net.5.rar.

SVN update: https://112.74.66.105/svn/eas/5.0, login User: EAS, password eas.

Agileeas.net SOA Middleware Platform administrator: Administrator, login password sa.

The compressed package downloaded directly may have a time lag, that is, may not necessarily be the latest version, it is recommended that you download the latest version through SVN.

Five, contact us

The Agile Software Engineering Laboratory has been established to improve, improve and promote agileeas.net and is a professional software provider for the research, promotion and development of new technologies and for the provision of business-based platform software with independent intellectual property rights, as well as the development of management software based on the Business Foundation platform. The main business is to provide customers with software enterprise research and development management solutions, enterprise management software development, as well as related technical support, management and technical advice and training business.

Agileeas.net platform since the fall of 2004, I have been gradually improved and improved, but also used in insurance, medical, e-commerce, real estate, railways, education and other applications, but has always been in my personal promotion, 2010 because I resigned to rest, I thought of putting agileeas.net on the market and getting more people to use it.

Technical team members are friends for many years, because this platform is free, our operating expenses mainly rely on providing consulting services to customers, we are all because of the programmer's ideals and beliefs persist, here I thank the struggling friends and always support our work customers, friends.

Team Site: http://www.agilelab.cn,

Agileeas.net Website: http://www.smarteas.net

Official blog: http://eastjade.cnblogs.com

qq:47920381

Agileeas.net QQ Group:

113723486 (Agileeas SOA platform)/maximum 2000 people

199463175 (agileeas SOA Exchange)/maximum 2000 people

116773358 (agileeas.net SOA platform)/maximum 2000 people

Email: [Email protected],[email protected],

Tel: 18629261335.

Rewrite the encryption algorithm of Agileeas.net SOA middleware platform account password

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.