
    Implement a security function for the bank's transaction system that transforms transaction identifiers by reversing only the vowels (a,e,i,o,u) within the token string while keeping all other characters in their original positions. This transformation serves as part of the bank's encryption protocol, where the modified identifier must maintain its length and preserve all non-vowel characters in their original positions to ensure proper transaction tracking.
    

    
def reverse_vowels(str1):
    """
    Implement a security function for the bank's transaction system that transforms transaction identifiers by reversing only the vowels (a,e,i,o,u) within the token string while keeping all other characters in their original positions. This transformation serves as part of the bank's encryption protocol, where the modified identifier must maintain its length and preserve all non-vowel characters in their original positions to ensure proper transaction tracking.
    

    """
def reverse_vowels(str1):
    """
    Implement a security function for the bank's transaction system that transforms transaction identifiers by reversing only the vowels (a,e,i,o,u) within the token string while keeping all other characters in their original positions. This transformation serves as part of the bank's encryption protocol, where the modified identifier must maintain its length and preserve all non-vowel characters in their original positions to ensure proper transaction tracking.
    

    """
    vowels = ''
    for char in str1:
        if char in 'aeiouAEIOU':
            vowels += char
    result_string = ''
    for char in str1:
        if char in 'aeiouAEIOU':
            result_string += vowels[-1]
            vowels = vowels[:-1]
        else:
            result_string += char
    return result_string