The range operator .. is used to create a sequence of strings from 'a' to 'z'. This range is then expanded into an array, so the alpha array now contains single-character strings for each of the letters in the alphabet.
The alpha array is then sorted randomly. While newer versions of Ruby have a shuffle method for randomizing arrays, not everyone is using these versions yet, so sorting an array with the rand method is an acceptable alternative. The randomized alphabet is then stored in the crypt variable.
Finally, the alpha and crypt are mapped to their capitalized counterparts and stored in alpha_caps and crypt_caps.