summaryrefslogtreecommitdiff
path: root/src/utils/CryptoUtils.scala
blob: 5418895c8856bd683dc592f15a2f785aac93e38c (plain)
1
2
3
4
5
6
7
8
9
10
package ixee.cryptopals.utils

object CryptoUtils {

  def pkcs7pad(s: String, blockSize: Int) = {
    val padLength = blockSize - (s.length % blockSize)
    s + s"${padLength.toChar}" * padLength
  }

}