def rule(event):
    if all(
        [
            any(
                [
                    "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\LegalNoticeCaption"
                    in event.deep_get("TargetObject", default=""),
                    "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\LegalNoticeText"
                    in event.deep_get("TargetObject", default=""),
                ]
            ),
            any(
                [
                    "encrypted" in event.deep_get("Details", default=""),
                    "Unlock-Password" in event.deep_get("Details", default=""),
                    "paying" in event.deep_get("Details", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
