Updated the decrypt method to handle more encryption styles.