OpenFire randomString has too many digits

Description

In StringUtils numbersAndLetters string array duplicates digits 0-9 twice, this results in random strings which have less entropy than you might expect from their length (and incidentally causes the results to fail simple tests of randomness as different characters don't occur with the same frequency).

The practical loss of entropy is modest.[

https://github.com/igniterealtime/Openfire/blob/master/src/java/org/jivesoftware/util/StringUtils.java]

Stylistically the code in randomString has hard coded 72 when it should probably use the computed length of the array.

 

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Labels

Expected Effort

Minimal

Components

Fix versions

Affects versions

Priority

Created October 9, 2017 at 9:20 AM
Updated November 16, 2017 at 9:32 PM
Resolved November 16, 2017 at 9:32 PM