Custom encryption for JS string

How easy is it to run encryption for strings in functions? Specifically we are being asked to use aes128-cbc for a string

Write a method that implements that encryption (or find a library that does, and expose it through the typesystem) then call that method…

Or am i confused by the question…