This document introduces a novel functional encryption (FE) scheme designed to be secure against selective opening attacks (SOA), termed as SO-FE. The proposed construction enhances privacy by allowing messages encrypted by an adversary to remain confidential even if parts of the messages or the randomness used in encryption are revealed. The authors emphasize the scheme's adaptability to various functionalities, including identity-based encryption (IBE) and attribute-based encryption (ABE), while allowing encryption of any bit length.