public static function decrypt(string $data, string $password): string
    {
        // Find the IV at the beginning of the cypher text
        $iv = self::substr($data, 0, self::IVSIZE);
        // Gather the checksum portion of the encrypted text
        $checksum = self::substr($data, self::IVSIZE, self::CKSIZE);
        // Gather message portion of encrypted text after iv and checksum
        $cyphertext = self::substr($data, self::IVSIZE + self::CKSIZE, null);

        // Derive key from password
        $key = self::hash($iv, $password);
        // Checksum : Create a keyed hash for the decrypted data
        $sum = self::hash($iv . $cyphertext, $key);

        if (! hash_equals($checksum, $sum)) {
            throw new InvalidArgumentException('Decryption can not proceed due to invalid cyphertext checksum.');
        }
        // Decrypt the given data
        $decrypted = openssl_decrypt($cyphertext, self::CIPHER, $key, OPENSSL_RAW_DATA, $iv);
        if ($decrypted === false) {
            // @codeCoverageIgnoreStart
            throw new RuntimeException('Encryption library: Decryption (symmetric) of content failed: ' . openssl_error_string());
            // @codeCoverageIgnoreEnd
        }

        return $decrypted;
    }