Will decrypt the url safe base64 encoded crypted str or bytes array.
        Args:
            cipher_text: the encrypted text
            max_timedelta: maximum timedelta in seconds

        Returns:
            the original message list
548627
def validate(self, cipher_text, max_timedelta=None):
        
        if isinstance(cipher_text, six.string_types):
            cipher_text.encode()
        cipher_text = base64.urlsafe_b64decode(cipher_text)
        decrypted = self.encryption_suite.decrypt(cipher_text).decode().split(self.separator)
        message_list, dt = decrypted[:-1], decrypted[-1]
        dt = int(''.join(re.findall(r'\d+', dt)))
        now = int(time.time())
        if max_timedelta and max_timedelta < now - dt:
            raise ValueError('Expired')
        return message_list, dt
437401
def decoded(self):
        
        logging.info("Decoding message: {0}".format(self.message))
        self.offset = self.offset * -1
        return self.cipher()
229167
def decrypt(self, data):
        
        if False in six.itervalues(self.ready):
            raise CipherError(data)
        decryptor = self._cipher.decryptor()
        tmp = decryptor.update(data) + decryptor.finalize()
        self.iv = data[-self.block_size:]
        return tmp
523213
public String decrypt(String cipherText) throws MissingParameterException {

		if (StringUtils.isBlank(cipherText)) {
			throw new MissingParameterException("Missing parameter: cipherText");
		}

		return stringEncryptor.decrypt(cipherText);
	}
734641
def Decrypt(self, encrypted_data):
    
    index_split = -(len(encrypted_data) % Blowfish.block_size)
    if index_split:
      remaining_encrypted_data = encrypted_data[index_split:]
      encrypted_data = encrypted_data[:index_split]
    else:
      remaining_encrypted_data = b''

    decrypted_data = self._blowfish_cipher.decrypt(encrypted_data)

    return decrypted_data, remaining_encrypted_data
61382
function decrypt($ciphertext)
    {
        if ($this->mode_3cbc && strlen($this->key) > 8) {
            return $this->_unpad(
                $this->des[0]->decrypt(
                    $this->des[1]->encrypt(
                        $this->des[2]->decrypt(
                            str_pad($ciphertext, (strlen($ciphertext) + 7) & 0xFFFFFFF8, "\0")
                        )
                    )
                )
            );
        }

        return parent::decrypt($ciphertext);
    }
623261
def decrypt(crypt_text) -> str:
        
        cipher = Fernet(current_app.config['KEY'])
        if not isinstance(crypt_text, bytes):
            crypt_text = str.encode(crypt_text)
        return cipher.decrypt(crypt_text).decode("utf-8")
762825
def decode_auth_plain(ciphertext)
      message = begin
                  @ecc.ecies_decrypt ciphertext[0,307]
                rescue
                  raise AuthenticationError, $!
                end
      raise RLPxSessionError, 'invalid message length' unless message.size == 194

      sig = message[0,65]
      pubkey = message[65+32,64]
      raise InvalidKeyError, 'invalid initiator pubkey' unless Crypto::ECCx.valid_key?(pubkey)

      nonce = message[65+32+64,32]
      flag = message[(65+32+64+32)..-1].ord
      raise RLPxSessionError, 'invalid flag' unless flag == 0

      [307, sig, pubkey, nonce, 4]
    end
260973
def decryptWithSessionRecord(self, sessionRecord, cipherText):
        

        previousStates = sessionRecord.getPreviousSessionStates()
        exceptions = []
        try:
            sessionState = SessionState(sessionRecord.getSessionState())
            plaintext = self.decryptWithSessionState(sessionState, cipherText)
            sessionRecord.setState(sessionState)
            return plaintext
        except InvalidMessageException as e:
            exceptions.append(e)

        for i in range(0, len(previousStates)):
            previousState = previousStates[i]
            try:
                promotedState = SessionState(previousState)
                plaintext = self.decryptWithSessionState(promotedState, cipherText)
                previousStates.pop(i)
                sessionRecord.promoteState(promotedState)
                return plaintext
            except InvalidMessageException as e:
                exceptions.append(e)

        raise InvalidMessageException("No valid sessions", exceptions)
690179
def decode_ack_plain(ciphertext)
      message = begin
                  @ecc.ecies_decrypt ciphertext[0,210]
                rescue
                  raise AuthenticationError, $!
                end
      raise RLPxSessionError, 'invalid message length' unless message.size == 64+32+1

      ephemeral_pubkey = message[0,64]
      nonce = message[64,32]
      known = message[-1].ord
      raise RLPxSessionError, 'invalid known byte' unless known == 0

      [210, ephemeral_pubkey, nonce, 4]
    end
1122061
def decryptstring(enc, password):
    

    dec = []
    enc = base64.urlsafe_b64decode(enc).decode()
    for i in enumerate(enc):
        key_c = password[i[0] % len(password)]
        dec_c = chr((256 + ord(i[1]) - ord(key_c)) % 256)
        dec.append(dec_c)
    return "".join(dec)
919319
def decrypt(self):
        
        if not self._crypter:
            return b''
        try:
            plaintext = self._crypter.decrypt(self._ciphertext, **self._decrypt_params)
            return plaintext
        except Exception as e:
            exc_info = sys.exc_info()
            six.reraise(
                ValueError('Invalid ciphertext "%s", error: %s' % (self._ciphertext, e)),
                None,
                exc_info[2]
            )
1104354
def decrypt(self, password_encrypted):
        
        if not password_encrypted or not self._crypter:
            return password_encrypted or b''
        return self._crypter.decrypt(password_encrypted)
1070672
public synchronized String decryptText(String text) {
		
		try {
			
			// Mise en mode Decrypt
			cipher.init(Cipher.DECRYPT_MODE, this.createDESSecretKey(stringKey));
			
			// Obtention des bytes
			byte[] encodedByteText = new Base64().decode(text);
			
			// Decryption
			byte[] byteText = cipher.doFinal(encodedByteText);
			
			// Retour de la chaine
			return new String(byteText);
			
		} catch (Exception e) {
			
			// On relance l'exception
			throw new RuntimeException(e);
		}	
	}
341682
def privmsg(self, text):
        
        if self.dcctype == 'chat':
            text += '\n'
        return self.send_bytes(self.encode(text))
370138
public String encryptText(String text)
	throws Exception
	{
		return toByteText(this.encrypt(text.getBytes(IO.CHARSET)));

	}
1373644
public static function unpackMessageForDecryption(string $ciphertext): array
    {
        $length = Binary::safeStrlen($ciphertext);

        // Fail fast on invalid messages
        if ($length < Halite::VERSION_TAG_LEN) {
            throw new InvalidMessage(
                'Message is too short'
            );
        }

        // The first 4 bytes are reserved for the version size
        $version = Binary::safeSubstr(
            $ciphertext,
            0,
            Halite::VERSION_TAG_LEN
        );
        $config = SymmetricConfig::getConfig($version, 'encrypt');

        if ($length < $config->SHORTEST_CIPHERTEXT_LENGTH) {
            throw new InvalidMessage(
                'Message is too short'
            );
        }

        // The salt is used for key splitting (via HKDF)
        $salt = Binary::safeSubstr(
            $ciphertext,
            Halite::VERSION_TAG_LEN,
            (int) $config->HKDF_SALT_LEN
        );

        // This is the nonce (we authenticated it):
        $nonce = Binary::safeSubstr(
            $ciphertext,
            // 36:
            Halite::VERSION_TAG_LEN + (int) $config->HKDF_SALT_LEN,
            // 24:
            \SODIUM_CRYPTO_STREAM_NONCEBYTES
        );

        // This is the crypto_stream_xor()ed ciphertext
        $encrypted = Binary::safeSubstr(
            $ciphertext,
            // 60:
            Halite::VERSION_TAG_LEN +
            (int) $config->HKDF_SALT_LEN +
            \SODIUM_CRYPTO_STREAM_NONCEBYTES,
            // $length - 124
            $length - (
                Halite::VERSION_TAG_LEN +
                (int) $config->HKDF_SALT_LEN +
                \SODIUM_CRYPTO_STREAM_NONCEBYTES +
                (int) $config->MAC_SIZE
            )
        );

        // $auth is the last 32 bytes
        $auth = Binary::safeSubstr(
            $ciphertext,
            $length - (int) $config->MAC_SIZE
        );

        // We don't need this anymore.
        \sodium_memzero($ciphertext);

        // Now we return the pieces in a specific order:
        return [$version, $config, $salt, $nonce, $encrypted, $auth];
    }