Here is my obj 17 encrypted, the ColorSpace value is the same as before encryption, so should i encrypt the hexa value inside the array value ?
17 0 obj
<<
/Length 5696
/Subtype /Image
/Width 327
/Height 113
/ColorSpace [ /Indexed /DeviceRGB 251 <0000000000000000000040004040402B2B2B242424202020171717005595152B152B2B1524242400609F2020201E1E1E1C1C1C0059991A261A2424182323172020201F1F1F1C261C005B9B1B241B2121212020201F1F1F1C231C23231C22221B21211A2020201F1F1F1F251F1E241E1D231D23231D22221C21211B00609F20201B1E231E1D221D22221D20201B1F231F1E231E1E221E22221E21211D20201C20201C1F231B1F231F1E221E1E221E21211D20201D00609F20231C1F221C1E221E22221E21211E21211D00609F20231D1F221C005E9E1E211E21241E20231D20221D1E211C21211C21211E21211E20231E00609F20231D20221D1F221D1F211C1F211C21231E20231E20221D20221D1F221D1F211D1F211C21231C20221E20221E005F9E20221D1F221D1F211D21231D20231C00609F20221E20221E1F211D1F211D1F211D21231D20221C20221C005F9C1F231D21231D21231D20221D20221C20221C1F211E005FA01F231D21221D20221D20221D1F211E1F231D20221D20221D20211C1F231E20221D0061A020221D00609F20221D1F231C1F221C1F221E20221D20221D00609F20221D20231D20231D1F221C20221D00609F20221D20231D20221D1F221C21221E20221E20211D20231D20221D20221D1F221D21221C20221C20221E20211D20221D005FA01F221D21221D20231D20221D20221D1F221D21221D20221D20231C20221E20221D1F221D20221D20211D20221C20221E1F221D0060A000609F20221D20221D20221D1F221D20221D20231D20221D20221D20221D1F221D20221D20221D20221D1F221D21221D20221D20221D20221D20221D20221D1F221D20221D20221D00609F00609F01609F01619F106AA5116AA5116BA520221D2074AB2174AB2175AB307EB1317EB1317FB14088B74188B74189B75092BD5192BD609CC3619CC370A6C97FB0CF80B0CF81B0CF8EB9D58FB9D59EC3DB9FC3DBAECDE1AFCDE1BED6E7BED7E7BFD7E7CEE0EDCEE1EDCFE1EDDEEAF3DEEBF3DFEBF3EEF4F9EEF5F9EFF5F9FEFEFFFEFFFFFFFFFF> ]
/BitsPerComponent 8
/Intent /Perceptual
/SMask 34 0 R
/Filter /FlateDecode
/DecodeParms <<
/Predictor 15
/Columns 327
>>
/Interpolate true
>>
stream
*eÜ¥Ìm}äÓ ¬håË>ñc³ßTyÜwwŠ?NìÛùúÀèÃ2$íy:ΚbŠ›X _¼¥ÎÔ
ÌÓs{œ²i…R4ö˜ö§ÇìZ>MæZDœŸ¼ög[øAôSi#‡ôUrÓ`@IùËÔ¹o–PÚ®°Š«q¢fpŠ¯¤zX™!× Qx/ÍÚÂý%åðr)HÎ¥ã>”1K$w¡~%§Á˸«£‡¿ªq'bj
\šVÅ ¾|hRrºßÔ6!¤c¤Ö †)¯d«¦&Ä-ä*
<cžàŸÃü_tÖXק)Œ.BnV“c{Ÿ'yâ9ëü×J¸ÇòáÉ %ðÔùaÝü ®eùkI+¤m’Žs¸Þ{cÅ#j¡†j̲^£˜;×Âi2Ñ,FÛ‰õ™«ªi)íÖ6A w‹[Òaª^´[ïª1ç2çÍ÷& ˆ¢¯ŠÃ¦iõa*¤îRª7B #ü²:Ê•\¦Bíqló«ŸÖ¶ ^iÆØh_§Ú$ÉÁ±ŒJ÷‹¥ JWJ}‘ïƒÂõÛ²ö9¾EÞšfgHaë´mÍ1-æHΔCg!tšI,¤
^辩ÓÐóÎI@ïj‡ZBr> b%ÄÆt ?]kþ$\î…9þc+Ëk®Hš/T
†lóˆG9«EX1¡Xjº®í…ãL£q’Gçï%¨é´ÇÁ} ®Çð'†þ°d¤•qè¯$÷¤´‘œžÄ×Dº¤ÑÊD½’m`žu=ªmÖ
úÎîjÓ15¯Þ.H”÷ix£IA›öeÆsxœÿ*k“îzž«`þh:©8uá}Žû9‘õÿ榲OTþHa'!e`ÙÄÒ=Y—KÄrå)À:YEð#?ÇX¬¿–m×θÜO£’ìé¶unâ
¯&L‚ ÚknÎńɳÈ%
´H:e…lfã06„‹ï#zôé tˆ×Q¬îBQèäcYÌú~¥ûA?É“ÉM”`.DÔ€8Kqº_1HK‰:D…Z;® t>ï«SdÛ ÛÃÀÛèï‡>Lõõäõ'ý‘T>?ƒÔ)®æœnºƒÁƒze†ÝO‹Ñ źÖ7´IwP"¦1GÞ¢ÛX̼˜HhZX‹‡“¯4Â<eEÆÔ‡_T…qõšìÝó:èæ¦c<Á—bsblþQê’ˆè¡ùSc-“ÆͽíÉÀ?K,Ÿ]wb²Š¶r0Vƒ¢[ S;eîü§`¤ýÓU¿c³?Á¦…20oô€a^?¥¸®ažhjŸv:ë«*`Ó¶¥Ü•k“G?ŒV¬p¾.¬ÊqŒ}×YžÙ˜Þ2U•ôÒ§©m.' U':´2xýBÍ&ì‹ßì$3´BZœ6»z|¾=t
-Y$›èú5ã(ÄAòõ¹a÷Ýí3Bòè?Ù{Agõ¦“þeÂEÃXM¢{«ìÏOuLª“(~…Œ#R·u2…ßÚbr@)˜Á^ÆïÎóYÒq&Ñ÷yWùF+v%yñ¼c¤lÀVKÄ‘÷vß½¾oã±l:#ßéùä—“#l}û¹9»ƒÌczwH¢5ô“›p®Ã'µè•-¢ÁsîžGÖ7‰ÓæïÄ9µ†+`¿‡:‚ºðŽ•™Ì ÁòÄòšúκlPŠý•L+o8ç+å݆toÄùX?¢œ>á‚v&PZ‡^ –÷3Æ1…&<XU ¢`ˆ^<&¹Ì÷ȉN« nºwRœ÷hŠa’ª€ Œ
û.(¾¡ñå…~WNÊr¸"Óö‘ç[¨DqõðEn“Ý`ìlù¦&.à¥ÅGÃXGí„zŽ?@2Y¢¹šš¬ëÅ¢R‘·›I{eHÿëÈñBPÓÚ´~#úg¡Orº•µ7¯ ô•ÉÃ$N9«h^¨êæcgÙè©«Ï«ysŒü}Û³q¬Zwˆ-M#ßÈ»',T}U¿"𣊛3€Œ÷–‘[—bÛI%.4ÝHì]äÕèk mois#¦!~¹hzFÉäal{`"cïlŸòò™aÓ{d^R†ëúOFŠ"oç°]ð#Ù¬ÞÀ†jÌO#ñˆ-†WR=w6kXÖå GH¡bÉg)7ÀTè•qo$jv”E˾ÀQ½ð h/ë/ü+|z
ø8|BJðŒ³ìX ÐÈ´9d*áë„i@Å€¼çÜ?ŸKt¤o<âæË®í_õµc
N{HYm+$éV¡ èãÊ´} ö€à±H\—îPm·Š9qQ;Ò ²E©÷úo•Û+®ìkÓäìmòPçO¢Þ¿†h~H°HPæG½uÜÚéðn…
/p7¡8±þ)…U£ï–Õ9õTt íç~k““£Ýl·m=>•ØÖ³Äi›îg§Ú7”Æ{vÕ¡kPšæÖ'ƒP»¿3+ٖıµ>³,YaÜZ7ÀÂãxâ$FZ+ÐJÃß©!>q%¼ê~ÂgÙÉþqZyÇÇzÚòÁ]q¬ y`ó…md\Î_Ö~8Ya!|ïÚd MR$b»Š§b(*pŒ®ÈtÀæÆ„IK-*´vôO²ºunÌùDð‚YcJP×õI|½3Ô5Hó‹ÖN˜ BúJB•î«T;Ú7'(Õ^N`Ît±4‹‹ÃJ+
ëC
ÄìábªÖa¼Ð
Êvê#¢oÄÈ0(1ÉÂŒ*iÇbu¸¹…%LQ"¦Ä(?ªèja›<§´.ê/Ï»qµJ`ÀI»º_Ök¾!nHµ.HFX°æ1Ð6u þ§›lCxCuÿù%=WˆÀCíÆÅãë›Aéäæ¼Iü+G‰Ñ^Ž"
’Ô‹¥ß¥3ñˆ Üdk~fµve æ«P¥¶–2¦¦¸aϽ{úAC×$WºÐÑéoECïP4Ir^ÀnDzò®]3·s;ÄyÃ,ý`s~ÖrZ±_NqqÆMÜj˜=æx$RŒò¤û:þùÒŽË
ªó—gèñr>Û4[Ä5Áö×<JA¾´0Îë _!¡ïQË……êMz7 ¶ žYý^ÇP¡ŒÌž½¼Ç
篕xÇì¼ï¦Ù~´ð úI¡ªÎÿøÒIEÑc=w Ã"¤Xäígy½ÎýjÕáp¢ÞìIÄ~M<§4ÿÜ÷y¨Ó•Jâçhºè2Sl„=‘åãþ8Úàˆ™þÙk$ wµ-BU:›ñ„èR{s¥œâêgÏlzv㶉oز_̯Yumר¦Ä(Üð®xFŠGcý5Ó#š´øÇ—"ØïÁÆnõ-ľu¯¿^a@|Û[42×tEFŠÉ_‰Ëò-Tsˆð”ñªE‡ù&1uÖ´y’“»Ç#‚ÖÏ}y†}îÙáLíD²Ã WÎ1QCŠÍ{ÔB`A´©/šQ†íÏXOêK#Lh< b®™)iœ¢ñ0ŸäÈ/ÎÃÑd¹µˆÿÞöŠ@%&ØÈ‹¾åyë}Õ©n…m6s¸pP½×8c?‹u¯\D-@!©eg([¹HÕIY°R½1æœ]Yâíét#®XȪ¡Wì]›{ÅÄe¤?}“S ˜º§ Ü
|>]B¦U†ÜÏ4E,ç—ÀÇ,tŸÐKäÐN¹‹X«ÆÎe’Îô&dŽÀg‰Ñ›«“5$šLþCŒ{"‘§v1KâÆÆš%,p.¶¹vRÍÛ7‚s²§::ª±Ð²" lÆmIc!¶qz*SI$ÂÜšs¤x
:ø¡oRluÇ•ÀhÐËQéÌÞÔQº'ÇL¿ƒÙ›¦
Í
ªöF–FjšÎ4§»ƒâÐ÷àóZO8-Û Ñud½6ƒ ¾ /ïþã->=äj½ŠŠÕs=Eyœß)0ú–ëØß¼$"jMËvø¾kX¡;K|'a^$Y0ù’;JI£ÁÒ\±Ÿ¤‹‹4
,_Ö+ÅMqC]-“ê»Ü²Ô¦]‘,—ìuXòx
":R§ØS_ö±Jªé³G½ÝCÒÅ:£Ø©iÌ,¦¢ØRĘÚææsc.fPà
˜¥l@ým9Ó¢»ah¥Nyii5¢lþ\.GÆ2s¡„Ù
»¿Àn®Üø[£Þíx‰a“¨Üõò¦‚vBgÑšŠ•¾©Êä´&NŠ]¾k|Þ²9;F%´‚2p6-!Ýû 7}Ï„í31>Šó³õ¡ ^¦Ä½"Ÿ{
ªéa%ðCÌåb¢MIeÏÕ4¤«ªiïÙ×´-¶F:¥W3uãœLoƒ-]0JIƒÁÑêæ•»©T3¾á#àžÒŠ¡è>Á•¹Œ!‰@œçd¡cmŒmŸ¿&¼‹ÄË]|¿WÝ_¿–³u„Š¨ H0@cðÞjñÓ®ý%»®Z“O?ÿÕ*Ï[®×‚“)še‘›É•ôˆÆFþh[¡~Šë. ¹¨ÿŠjÇe¢¬Ïëe[·gц%wŸG¦øÞßËi¿ßh'jE&UðÍã_ô(ô¼¬ç{‡KH÷<©FßNÚ¾‰9 Ó6ÑO× HxË\ÜÑÄ™ÍÙ;#³7Mz<íHlpb7ùwÂ^ÖˆAï*ò»kíR±ªAk|whß}°ŠþµvA(n–Y=ý›ÊI¿ÒZjw|Á’{ŠYÃ{§ÅLžø;à–'`‚ý›4¼Ý7óØØn©JDšY*Ç=ôéFmŠý–¶ÜŠºÉTu*áƒk_œí×eW9MñGgœ<CFé±Uàù !‡P|5ò\Stbv]Þd@‘úDô<ä'µWð}¹ÑKãö÷\Ï? ‰ßÖ]ÌDÊ9*ÀqxM™]2o`ÍOlð!ÓZ?riu¤5¹Æǹ-åÈ¿a«h®qpGi:œtcLm5æÏêŒ'a+¨ŠMÈ`÷/Ë¥R‰é6s×ÝæIàæ;¯´
DØ#Ù#«›&2˜tÉTèÒ”}_GìÖŒ§¸zfêý|ó8¯æ¤=^B@ÂðÝOªH©3¦;ÐÞ
ÈÒ~£ï',<³šâ•’
]b¨OQ÷s–l¬¢“5q•=!<’Üùv®3:k·BŽ¯å4y+6‡&E]ƒat9>`oÝú èa;ãų©¶ÛÍÜ\…Šhöž]s+x™dŸqûLÒΉ¯GÍ¥ö¨QâxÞ:a›s;ðíÒÚxéä0ËMX¡ßS··*â¿ÛwTëXknLjC-¦úÎs
1…“ÐYi
¼`…0Ì+µWñtƒ~þ9yL‚ùJÄ0m¼ÖêÑû™ïFÂi£ËËØ@a²'9å v†:ä÷ jõpO)·ô°½v Tñ¯¸‘3ž»éÿ†@·¢æŠWÏ#-{t‡žº!an,Ia\³i¨Y·ýmíÐÍeàR©”‰^Zø5~)A³)lf[¿Ù`ïXÿZ'8½!éÈ)mü-S®ýD~X¢§`kì³ÕKóâþfP)×2†ùÛºïÕé8”ð=üŠ@œvŠy`a@)
xï3½ª¾ZòÄ–Ž~OŽTDÕß™*íP’()ÔûE]Íò¥ˆG@Î á^0c¬‰M|VùýúÇ-ÜàÚ°;HkxZ!Ù»6ÄÏ1žîèrÓÜäƒÞèÇkÕ’Œjóˆ
øæ*w¸fñCÏÜd’x$PæøÜÄ,Ý€áœe¥ÃºçM3›/ûƒ‚÷ÇýA1^g»z=_{Ð8Ò!Áø ßýÙñ"3¢£˜<T|õR‡'ÀH –ÍÒÝð:n9?Ì®{úgŠW™zåZ¸®÷GÇ<+jaZD(Ý7PöOU>’6âÜ#™fYX)`ôT hX…àÔØŪ@&ƒ+`™Û±²Ð”îCNì gÕo£4ÞµÔÖÔÑE&¹ÜÄcª5D¿~
±ó*$‹]Ó«¼À.µ0§µ:yxµŒ=],\Ç4©âM‰gñ/ÞâÔkʃ•C‹õн¦0ZìßÉ¢ÛV¼úÊ#%+ûKM^;{yEQ6Ð6{uÓNÃt—{é8¨—ô‘ÇÍxÚ(Ù‘Iºp¥AA3µo¤kµ«@ƒÒ·µn©Í‘j–q0ˆc
æÏ°Ø÷ùöýjdó7[y†tÒh>ÑÒ®î1áz£ P§€(ºÏz÷Ä»[EëCyöv剘¤ääþ¹j_ˆc×LÔ]|¢ÿšÉ
¯\PåFúuɾŠs§öaå½JFc†Š}5‚ÆÑr2#ODbÓµ”›Áz¿ šÝ?«/¶øÍÛ`ú߯CXP\?[”Ž‰œ‚$ï¡™G›ý<¹RÚ‘×w’TÝFBÏŒG ¡_«z<J%/+?Ë(ÝëgùéQr)ðRʹq[
êî†:Õö.@ÿªý:d’wTÇH,¶¦Ÿ=A§¾ÛYûÁ§šbW#£]¥¬R5ÝwÏÞ¬z‚,Ú˜n-ël tðW‘·½Gqd¸ìнt2ĶlŽæøx:›tí
°Šú¸e¸¼05¡SuT@ýQE•øÊ$΄šÏJ— ¿žè
9.j4â€wpš é†~*—øœP…¹¼ñtà绀÷€\^«Û\‹Ë¢î®ùú<juSʨ{樂½õ±Zð¦À{…ÞÝoùh¢•dŸv¯ÄdøÁ–kH¦Æ»rµû›ò¼@yø#Í`+ÆB/†™¢eq¤†1H!ýr÷ÐÉðv¿ÃHªaæeuì__ÃQ3Œ·ËN¯_{ìJa$ç¢×\l7L¥ˆÄ‘§Áö‚»¾Ñ–ŒË¡› EŒ=êÁ\´k‹
b‹B
†ÿÿåQ,šò/‘ð¿ðqu–®º¥k(€’ŠŠ
?úÇt³Òu:ºƒ³’ÑÎ9Ù¡Ž 6ÖïØKø$—JQxge2M,T£¶öœsŽÁf[Q#\§ïþâ¡%P»¬½¾
g?žÂR¡—þ/ZšÒðA‰î{WÄÙh)ä¯Zß•ÇÃÕs6{y¡„m[áÝq[½Þc'¯¾Ê£…sÌ)ó«ÐSæƒ=¿çfåñ7ü› ü?5ÅÙš8‰¼0ìy²}Åêài ÅÜ…ÿnÞØ%)²ÓY<ο©²ÏžþÚÁO:ú¡«àÜ©`Å B0…ˆ¶ñ–ƒ¢H@x×¼Àt¤`Ý={„*ë°æ)Áö™>K5-ÂÆ
‹ž§7ó#¥›9†ÉR»Áûd…{ÛL(< žšXVNí¬®¬F®;<&÷JRÂO
zˆñ¦é®–½çLÕÂCQÁ¹«¾ÏmÒ¹£5!]‰EvΧêíé.ˆ-Aë ™_MȘdî÷˜”Wx|jb ØR\
n7coìð¾¡uM[–â2ëÙ
ÌtU8?gÙ=nö—ˆ™ÂÅz'„p?
endstream
endobj
I use pdf-lib.js with pdf-security.js (with code added), it works, the pdf is encrypted, for others pdf, but in this pdf the i have 3 images, the 2 images colors are not corrupt and i noticed that they have no array (/ColorSpace /DeviceRGB), but this obj 17 have and array as ColorSpace value with an hexa value inside.
The hex value is the color palette and it is represented as a PDF string, so it needs to be encrypted.