String x_temp_str2
The integer x_length
The integer x_position1
The integer x_position2
The integer x_temp_int1
The integer x_temp_int2
User_string=trim (user_string)
User_string=upper (user_string)
Pw_string=trim (pw_string)
Pw_string=upper (pw_string)
If len (pw_string) & gt; 0 then
X_length=len (user_string)
X_position1=1
X_temp_int1=0
The do while x_position1 & lt;=x_length
X_temp_str1=mid (user_string x_position1, 1)
X_temp_int2=asc (x_temp_str1)
X_temp_int1=x_temp_int1 + x_temp_int2
X_position1 + +
Loop
X_temp_int1=x_temp_int1 + x_length
The do while x_temp_int1 & gt; 122
X_temp_int1=x_temp_int1-75
Loop
X_temp_str2=left (pw_string, 1)
X_temp_int2=asc (x_temp_str2)
X_temp_int1=x_temp_int1 + x_temp_int2
If x_temp_int1 & gt; 122 and x_temp_int1 & lt; Then 198
X_temp_int1=x_temp_int1-75
End the if
If x_temp_int1 & gt; Then 197
X_temp_int1=x_temp_int1-133
End the if
If x_temp_int1 & gt; 57 and x_temp_int1 & lt; Then 65
X_temp_int1=x_temp_int1-7
End the if
If x_temp_int1 & gt; 90 and x_temp_int1 & lt; Then 97
X_temp_int1=x_temp_int1-6
End the if
X_length=len (pw_string)
X_temp_int2=x_length - 1
Pw_string=char (x_temp_int1) + right (pw_string x_temp_int2)
X_position1=1
The do while x_position1 & lt;=x_length
X_temp_str1=mid (pw_string x_position1, 1)
X_temp_int1=asc (x_temp_str1)
X_position2=x_position1-1
If x_position2=0 then
X_position2=x_length
End the if
X_temp_str2=mid (pw_string x_position2, 1)
X_temp_int2=asc (x_temp_str2)
X_temp_int1=x_temp_int1 + x_temp_int2
If x_temp_int1 & gt; 122 and x_temp_int1 & lt; Then 198
X_temp_int1=x_temp_int1-75
End the if
If x_temp_int1 & gt; Then 197
X_temp_int1=x_temp_int1-133
End the if
If x_temp_int1 & gt; 57 and x_temp_int1 & lt; Then 65
X_temp_int1=x_temp_int1-7
End the if
If x_temp_int1 & gt; 90 and x_temp_int1 & lt; Then 97
X_temp_int1=x_temp_int1-6
End the if
If x_position1=1 then
X_temp_int2=x_length - 1
Pw_string=char (x_temp_int1) + right (pw_string x_temp_int2)
The else
X_temp_int2=x_length - x_position1
X_position1=x_position1-1
Pw_string=left (pw_string x_position1) + char (x_temp_int1) + right (pw_string x_temp_int2)
X_position1 + +
End the if
X_position1 + +
Loop
The else
Pw_string=""
End the if
Return pw_string
CodePudding user response:
Password encryption?CodePudding user response:
Estimation is encryption functionCodePudding user response:
String x_temp_str1//string variableString x_temp_str2//string variable
Integer x_length//integer variables
Integer x_position1//integer variables
Integer x_position2//integer variables
Integer x_temp_int1//integer variables
Integer x_temp_int2//integer variables
//directly from here, user_string should be a global variable, or the parameters of the function variables,
User_string=trim (user_string)//removes white Spaces at the sides
User_string=upper (user_string)//to uppercase
Pw_string=trim (pw_string)//removes white Spaces at the sides
Pw_string=upper (pw_string)//to uppercase
If len (pw_string) & gt; 0 then//if pw_string length is greater than zero, perform here
X_length=len (user_string)//get the length of the user_string
X_position1=1
X_temp_int1=0
The do while x_position1 & lt;
=x_length//cycleX_temp_str1=mid (user_string x_position1, 1)//in turn take user_string characters
X_temp_int2=asc (x_temp_str1)//get the character of asc code
X_temp_int1=x_temp_int1 + x_temp_int2//these characters of the asc code add
X_position1 + + 1//position (one-way,
Loop
X_temp_int1=x_temp_int1 + x_length//all of the characters of asc and + string length
//using the circulation, which in turn minus 75, makes the final value is not more than 122,
The do while x_temp_int1 & gt; 122
X_temp_int1=x_temp_int1-75
Loop
X_temp_str2=left (pw_string, 1)//password to the left of the first character
X_temp_int2=asc (x_temp_str2)//to asc code
X_temp_int1=x_temp_int1 + x_temp_int2//two variables together,
//in according to the requirement of the data range, reduce the
If x_temp_int1 & gt; 122 and x_temp_int1 & lt; Then 198
X_temp_int1=x_temp_int1-75
End the if
//in according to the requirement of the data range, reduce the
If x_temp_int1 & gt; Then 197
X_temp_int1=x_temp_int1-133
End the if
//in according to the requirement of the data range, reduce the
If x_temp_int1 & gt; 57 and x_temp_int1 & lt; Then 65
X_temp_int1=x_temp_int1-7
End the if
//in according to the requirement of the data range, reduce the
If x_temp_int1 & gt; 90 and x_temp_int1 & lt; Then 97
X_temp_int1=x_temp_int1-6
End the if
//get here should be seed,
X_length=len (pw_string)//password length
X_temp_int2//length=x_length - 1 minus 1
//put the seeds into characters, deserve to go up again the password at the back of the string, and get a new string
Pw_string=char (x_temp_int1) + right (pw_string x_temp_int2)
X_position1=1
//cycle
The do while x_position1 & lt;=x_length
X_temp_str1=mid (pw_string x_position1, 1)//take characters
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull