1

Topic: Difference of the new password from old more than on 3 characters by means of Regexp

All kind day!
Whether there is a task to define differs the new password from old more than 3 characters in different positions. Whether generally really such with small losses?
Decided to try through Regexp_Replace.

select regexp_replace (' T254est_123 ', ' (T|e|s|t | _ | 1|3) ') from dual
-------
Result
2542

But all falls, if the new password comprises digit 2.

select regexp_replace (' T254est_123 ', ' (T|e|s|t | _ | 1|2|3) ') from dual
-------
Result
54

That is the last twain too left...
Further at me the imagination is not went, therefore I ask for suggestions

2

Re: Difference of the new password from old more than on 3 characters by means of Regexp

0
0
All characters in different a position different - and I pound in your check much?

3

Re: Difference of the new password from old more than on 3 characters by means of Regexp

aidynchik;
crutches for bicyclists

4

Re: Difference of the new password from old more than on 3 characters by means of Regexp

aidynchik wrote:

I ask for suggestions

the requirements to passwords are more rigid, the it is easier such passwords are compromised with storage in the text file, writing on a leaflet, transfer by mail, to messengers, etc.
Besides, knowing requirements of length, presence of digits and a punctuation, it is possible to restrict essentially an amount of combinations for a brut-swagger.

5

Re: Difference of the new password from old more than on 3 characters by means of Regexp

: 630 wrote:

the requirements to passwords are more rigid, the it is easier such passwords are compromised with storage in the text file, writing on a leaflet, transfer by mail, to messengers, etc.
Besides, knowing requirements of length, presence of digits and a punctuation, it is possible to restrict essentially an amount of combinations for a brut-swagger.

And the chance more that the user makes the password 123.

6

Re: Difference of the new password from old more than on 3 characters by means of Regexp

aidynchik;
Sm utl_match, for example
utl_match.edit_distance

7

Re: Difference of the new password from old more than on 3 characters by means of Regexp

At  the purposes and milestones

8

Re: Difference of the new password from old more than on 3 characters by means of Regexp

;
I can than I can help?

9

Re: Difference of the new password from old more than on 3 characters by means of Regexp

Distance on  to compare between passwords? Truth it is measured in swaps, but, I feel, it near to the HARDWARE task.

10

Re: Difference of the new password from old more than on 3 characters by means of Regexp

: 630 wrote:

it is passed...
The requirements to passwords are more rigid, the it is easier such passwords are compromised with storage in the text file, writing on a leaflet, transfer by mail, to messengers, etc.
Besides, knowing requirements of length, presence of digits and a punctuation, it is possible to restrict essentially an amount of combinations for a brut-swagger.

As here told - at  the purposes smile to it the main thing that so worked, and further though the grass not to grow

11

Re: Difference of the new password from old more than on 3 characters by means of Regexp

aidynchik;
If the password has to differ on 3 Regexp characters here at all at what. select count (1) from (select letters of the new password minus select letters of the old password)> 3. Enjoy.
Stupid rules-> stupid decisions

12

Re: Difference of the new password from old more than on 3 characters by means of Regexp

You already clarified, where and how  stores passwords?

13

Re: Difference of the new password from old more than on 3 characters by means of Regexp

AmKad;
Judging by implementation, here is faster

select does_passwords_differ (' Plain text old password ', ' Plain text new password ') as dummy from dual

14

Re: Difference of the new password from old more than on 3 characters by means of Regexp

env;
*do

15

Re: Difference of the new password from old more than on 3 characters by means of Regexp

aidynchik;
[spoiler]

WITH t AS
(SELECT ' T254est_123 ' AS old_p
,' Test_13 ' AS new_p
FROM dual)
SELECT ss
FROM (SELECT substr (old_p, LEVEL, 3) AS ss
,new_p
FROM (SELECT old_p
,new_p
FROM t)
CONNECT BY LEVEL <= length (old_p) - 2) t2
WHERE instr (new_p, ss)> 0

[/spoiler]

16

Re: Difference of the new password from old more than on 3 characters by means of Regexp

DECLARE
new_password VARCHAR2 (20): = ' 123456ddd ';
old_password VARCHAR2 (20): = ' 123454ddd ';
diff NUMBER: = 0;
l NUMBER;
BEGIN
IF length (new_password) <length (old_password) THEN
l: = length (new_password);
ELSE
l: = length (old_password);
END IF;
FOR i IN 1. l LOOP
IF substr (new_password, i, 1)! = substr (old_password, i, 1) THEN
diff: = diff + 1;
END IF;
END LOOP;
dbms_output.put_line (diff);
IF diff <3 THEN
dbms_output.put_line (' there are less than 3 identical characters in on one position ');
ELSE dbms_output.put_line (' there are more than 3 identical characters in on one position ');
END IF;
END;

But it has been truly noticed that 0 and 0 all in different positions.

17

Re: Difference of the new password from old more than on 3 characters by means of Regexp

Moss;
That you heaped plsql, it is possible to express nested calls of functions. Though there are nuances with the coding.

18

Re: Difference of the new password from old more than on 3 characters by means of Regexp

utl_;
I do not argue with you. I heaped that it was explicitly visible as as I compare...