6 kyu

Playing with passphrases

423 of 11,830g964

Description:

Everyone knows passphrases. One can choose passphrases from poems, songs, movies names and so on but frequently they can be guessed due to common cultural references. You can get your passphrases stronger by different means. One is the following:

choose a text in capital letters including or not digits and non alphabetic characters,

  1. shift each letter by a given number but the transformed letter must be a letter (circular shift),
  2. replace each digit by its complement to 9,
  3. keep such as non alphabetic and non digit characters,
  4. downcase each letter in odd position, upcase each letter in even position (the first character is in position 0),
  5. reverse the whole result.

Example:

your text: "BORN IN 2015!", shift 1

1 + 2 + 3 -> "CPSO JO 7984!"

4 "CpSo jO 7984!"

5 "!4897 Oj oSpC"

With longer passphrases it's better to have a small and easy program. Would you write it?

https://en.wikipedia.org/wiki/Passphrase

Strings
Algorithms

More By Author:

Check out these other kata created by g964

Stats:

CreatedJul 2, 2015
PublishedJul 2, 2015
Warriors Trained42239
Total Skips11123
Total Code Submissions71056
Total Times Completed11830
Ruby Completions423
Python Completions2541
C# Completions842
Java Completions1690
JavaScript Completions2064
Haskell Completions182
CoffeeScript Completions36
Clojure Completions107
TypeScript Completions438
C++ Completions1100
PHP Completions596
Crystal Completions13
C Completions568
Swift Completions252
F# Completions63
Shell Completions86
OCaml Completions32
Julia Completions23
Scala Completions108
R Completions54
NASM Completions11
PowerShell Completions48
Go Completions340
Nim Completions17
Rust Completions235
Racket Completions24
Kotlin Completions300
Pascal Completions7
Perl Completions22
Elm Completions8
D Completions7
Prolog Completions11
COBOL Completions3
Total Stars641
% of votes with a positive feedback rating90% of 1845
Total "Very Satisfied" Votes1502
Total "Somewhat Satisfied" Votes308
Total "Not Satisfied" Votes35
Ad
Contributors
  • g964 Avatar
  • jhoffner Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • FArekkusu Avatar
  • monadius Avatar
  • hobovsky Avatar
  • uniapi Avatar
  • akar-0 Avatar
  • Just4FunCoder Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
Ad