Generating random complex passwords with Perl

Source: Internet
Author: User

#!/usr/bin/perlmy  $characterset  =  ' abcdefghijkmnopqrstuvwxyz23456789abcdefghijklmnpqrstuvwxyz '; # $characterset  .=  ' [email protected]$%^ () _{},./<>?-'; # $characterset  .=  "[Email  protected]$%^&* () _+| {},./<>?-=\ "; # $characterset  .=  ' [email protected]#$%^* () _| {},./<>?-=\ '; $characterset  .=  ' @#%^* () _=-~,.?;: | '; my  $mininum  = 8;my  $maxinum  = 10;sub MakePassword{my  ($composition,   $lowlength,  $highlength)  = @_;return  " unless  $composition; my @p  = split //,  $composition;my  $arraylength  = @p; $lowlength  = 7  if  $lowlength  < 1; $highlength  =7 if  $highlength  < 1;if   ($lowlength  >  $highlength)  {($highlength,  $lowlength)  =  ($lowlength,   $highlength);} my  $length  = int (rand ($highlength  -  $lowlength  + 1) $length  +=  $lowlength;my  $password  =  ';for  ( 1. $length)  {my  $i  = int (rand ($arraylength)), $password  .=  $p [$i];} return  $password;} my  $password  = MakePassword  ($characterset,  $mininum,  $maxinum);p rint  "$ Password\n ";



--------------------------------------Split Line--------------------------------------

Hall of Understanding ( http://zhishuedu.com Training is a professional quality training brand jointly launched by senior MySQL expert Ye Jinlong and Wu Bingxi, which mainly includes MySQL DBA combat optimization and Python Operation Development Course, which is the most conscientious and quality training course in the industry.

This article is from the "Lao Ye teahouse" blog, please be sure to keep this source http://imysql.blog.51cto.com/1540006/1879728

Generating random complex passwords with Perl

Related Article

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.