With the increasing of the number of sites, due to the time problem for users registered write password blurred, and often once input error preventing all operations, without considering the long-term users logged for password memory decrease, only to change the password authentication method to experience to visit the user better. Edit distance (Levenshtein Distance, LD) algorithm is usually used in the string of fast matching, writing, this classic algorithm provides string distance is defined on the basis of the theory, through the analysis of the influence of time factor to be deformed and get new strings generated method. The article chooses the login password as the research object, and then analyzes the definition of the character of the string by analyzing the user defined custom and generates a new fuzzy cipher algorithm. First, the user input string combined analysis, and then according to the different distance to produce a different fuzzy character set, and finally the generated fuzzy character set after Hash encryption into the database. The under Windows system using language C# written test of the algorithm, prove that the algorithm can produce the corresponding fuzzy character set, and achieve the expected goals, and the logged in user experience is better, for landing improved way to provide new ideas.